Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mySQL, Java & rollback behavior



the database can't roll back sequence assignments as there are concurrency issues. mess with this behaviour at your peril! advise leaving this well alone. there are no side effects to having gaps in the ID distribution.



I believe this is normal, if annoying, mysql behavior: auto increment fields only ever go up. There may be an easier solution, but you should be able to do something like:

    ALTER TABLE table_name SET AUTO_INCREMENT=100;

to reset the counter. In practice, of course, you'd use the result of something like "SELECT MAX(key_field) FROM table;" instead of "100".

Philip

_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >mySQL, Java & rollback behavior (From: Kevin Muldoon <email@hidden>)
 >Re: mySQL, Java & rollback behavior (From: Michael Hall <email@hidden>)
 >Re: mySQL, Java & rollback behavior (From: Philip Isenhour <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.