1 message in com.mysql.lists.win32lock InnoDB table having AUTOCOMMIT=1
FromSent OnAttachments
Annemarie Mayer-Retar18 Apr 2005 02:01 
Subject:lock InnoDB table having AUTOCOMMIT=1
From:Annemarie Mayer-Retar (amma@gmx.at)
Date:04/18/2005 02:01:25 AM
List:com.mysql.lists.win32

I'm using MySQL 4.1.7 and InnoDB tables. I'd like to lock some tables for (write and) read of other users during a transaction, like this:

START TRANSACTION; LOCK TABLES T1, T2; ... ... UNLOCK TABLES T1, T2; COMMIT;

Since I have AUTOCOMMIT=1, this does not work: "You should not have AUTOCOMMIT = 1, because then InnoDB releases its table lock immediately after the call of LOCK TABLES" (according to http://dev.mysql.com/doc/mysql/en/lock-tables.html).

Do I have an alternative, having AUTOCOMMIT=1, to lock tables for read access during a transaction? I considered SELECT * FROM table FOR UPDATE, but this does not seem to perform a read lock.

Thank you for any suggestions, Anne

GMX Garantie: Surfen ohne Tempo-Limit! http://www.gmx.net/de/go/dsl