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?
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?