MySQL Forums
Forum List  »  Newbie

Re: Simulating sequences
Posted by: Bonnie Kenison
Date: July 02, 2014 01:09PM

>>>last_insert_id() doesn't work with deletion. Any possibility a row was deleted by another process?

This is not a table we do deletions on (except for an overnight clean-up routine), so I can safely say that no threads are deleting.

>>>No error messages after that execute() call? No errors or warnings in the mysql or php logs?

I am using Java, but there are no exceptions or warnings. The only difference is that I sometimes get a "zero rows updated" situation.

>>>Did you try putting the code in a standard transaction block with rollback code?

I have the code in a single transaction - with just the two sql statements (the update and the select last_update_id). I could put in some error handling to simply rollback/retry the update statement when I get a zero rows updated situation, but I want to understand the situation first.

So, back to the original question: Is the update statement SUPPOSED to lock the row for its full execution (read/increment/update) or is that not thread safe?

Options: ReplyQuote


Subject
Written By
Posted
June 30, 2014 10:26AM
June 30, 2014 10:49AM
Re: Simulating sequences
July 02, 2014 01:09PM
July 02, 2014 01:37PM
July 03, 2014 12:17PM
July 07, 2014 08:50AM
July 07, 2014 11:25AM
July 07, 2014 08:16PM
July 08, 2014 03:08PM
July 08, 2014 08:03PM
July 09, 2014 12:56PM
July 09, 2014 03:13PM


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.