Daniel-Constantin Mierla writes:
"LOCK TABLES is not transaction-safe and implicitly commits any active transaction before attempting to lock the tables. " That seems to say, if you start transaction then do lock tables, the transaction is committed.
yes. does not sound like a good idea to lock tables between START TRANSACTION and COMMIT or ROLLBACK.
In the code I saw that transaction start function can lock tables based on a parameter, but after start transaction -- which on the light of above statements mean closing the just opened transaction. Then I assume several queries are done from the module, which are supposed to be part of a transaction, but it might not exist anymore if I understand correctly the documentation.
it seems that tables cannot be locked before calling START TRANSACTION either because of this text:
If a session begins a transaction (for example, with START TRANSACTION), an implicit UNLOCK TABLES is performed, which causes existing locks to be released.
that leads to the conclusion that transactions and table locking cannot be used together in mysql.
-- juha