Re: Simulating sequences
>>>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?
Subject
Written By
Posted
Re: Simulating sequences
July 02, 2014 01:09PM
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.