Database sequences operate
outside of the transaction mechanism (i.e. sequences do not get locked like records do).
Once a NEXT-VALUE has been executed against a database sequence the sequence has been updated and will not be rolled back to its previous value.
The following example code shows how sequences are not rolled back.
A
ssuming a sequence named Fred with a current value of 5...
do transaction:
create customer.
/* increment the value of the sequence from 5 to 6 and returns 6 */
assign customer.custnum = next-value(Fred).
/* force undo of transaction and rollback */
undo, leave.
end.
/* this will display 6 because the sequence was incremented using next-value */
display current-value(Fred).
/* and sequences do not get rolled back */
The following Articles outline the consequences of Sequences outside of the transaction mechanism