MySQL Forums
Forum List  »  InnoDB

Re: AUTOINCREMENT & ROLLBACK
Posted by: Rick James
Date: March 14, 2009 02:18PM

There are a lot of workarounds. But first, why do you care?

Don't use auto_increment if you are not willing to live with how it is implemented. This would imply creating your id some other way.

Something else you might 'dislike'...
* Process 1 does BEGIN and gets id 123
* Process 2 does BEGIN and gets id 124
* Process 2 COMMITs; 124 now is really in the table, but 123 is still pending.
* Process 1 COMMITs.
That is, the transactions _started_ in order 123, 124, but _finished_ in order 124, 123. This is a tough one to "fix". This could matter if you have some process walking through the table -- it could get to 124 without realizing that 123 is yet to come. :(

Options: ReplyQuote


Subject
Views
Written By
Posted
5716
March 13, 2009 09:33AM
Re: AUTOINCREMENT & ROLLBACK
2403
March 14, 2009 02:18PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.