At the SPOD tutorial page, it is only mentioned that SPOD can be used
with transaction somehow, which will be introduced "later". Is it
My idea was to not use any of the lock options of the SPOD, but wrap
all my operations in standard cnx.startTransaction/commit calls (maybe
with some nesting management). That should work too, shouldn't it?
If you're using MySQL+InnoDB, then all SELECT that you make will return
the data that was visible at the start time of the transaction (which is
actually your first SELECT, not your START TRANSACTION).
You have to use SELECT ... FOR UPDATE (SPOD lock=true) before making an
update to make sure that :
a) the data you select is the actual data present in the database
b) other transactions will lock while doing the same SELECT/FOR UPDATE
on this row until your commit your transaction
MySQL have an immediate deadlock resolution and a lock wait timeout for