I have been reading about transactions in MySQL, but I could not understand one issue.
Transactions are a way to ensure that in a block of statements, either all are executed or none of them. However, Does a transaction ensures the “locking” of rows that are part of it? That is, say I have the following statements (pseudo):
1) START TRANSACTION
2) SELECT row1 FROM table
3) UPDATE table SET row1='new value'
4) COMMIT
Now, say a user tried to access row1 at the time where the system was at line 3 above.. Will that user have access to the row (and then he can see the old value of row1), or will he have to wait until the transaction is finished, and only then the row will be fetched with the new value.
Thanks!
Joel
No, transactions and isolation are two separate concepts.
Five levels of isolation: