If I am right, PDO transactions are not really transactions: they just disable auto-commands (see the documentation ).
So, if I have a transaction A that deletes a row and a transaction B that modifies the same row, the following may happen.
- Transaction A starts and disables auto-update.
- Transaction B starts and disables auto-update.
- Transaction A deletes a row.
- Transaction B modifies the same row.
- Transaction A completes and commits the changes.
- Transaction B completes and commits the changes.
But in step 6, the row was already deleted in step 5. What will happen?
Also, how can I ensure that transaction B is locked until transaction A? FYI, I am using PDO with mysql with innoDB.
Thanks.
source share