How can you avoid gaps with oracle seqeunces used within transactions that can rollback? From what I've just read about the create sequence command, sequences are incremented independent of the transaction committing or rolling back. Therefore, the sequence will be incremented even though, say an insert into a table rolled back.
Is there a good way to get the sequence back to what it was before it was incremented for failed transactions? I suspect there's all kinds of problems successful vs. failed transactions (i.e., resetting the sequence for a failed transaction at the same time another transaction succeeds.)
I guess a sequence shouldn't be used in this case and the number should be stored in table instead.
Is there a good way to get the sequence back to what it was before it was incremented for failed transactions? I suspect there's all kinds of problems successful vs. failed transactions (i.e., resetting the sequence for a failed transaction at the same time another transaction succeeds.)
I guess a sequence shouldn't be used in this case and the number should be stored in table instead.