This is standard and will always happen.
If you have 2 overlapping transactions you are making INSERTs
:
- Transaction 1 makes a
INSERT
, gets the ID
26 (for example)
- Transaction 2 makes a
INSERT
, gets the ID
27
So:
- If transaction 1 fails, reverse operation
- Transaction 2 is completed with
ID
27
If the consecutive values were guaranteed, each transaction would have to happen one after the other, i.e., would totally lose scalability. I wouldn’t worry about this type of control, because this type of standardization of data seems ineffective.
If the question is for enlightening effect I see no problem.
But for projects I do not recommend!
Through a Rigger.
– Maurivan
Can you give an example of how to do?
– Gonçalo
Already answered... tell me if it worked!
– Maurivan