MySQL Forums
Forum List  »  InnoDB

Optimistic locking/Repeatable read
Posted by: Larry Blair
Date: November 28, 2017 05:38PM

There doesn't appear to be a forum for asking questions like this.

We use repeatable read. I'd like to do optimistic locking, as in:

update foo
set version = version + 1, ...
where version = <original value> and ...;

This would be defeated if the value for version in the where clause is the one that was originally selected, even if it was updated in another transaction. Googling around, I see ambiguous statements about mysql's behavior. Some indicate that mysql will use the current committed valuer of version, but nothing is clear. Is it possible to to optimistic locking with repeatable read?

Options: ReplyQuote


Subject
Views
Written By
Posted
Optimistic locking/Repeatable read
2675
November 28, 2017 05:38PM
813
November 29, 2017 11:37AM


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.