]> MySQL Transaction locking. 🌐:aligrant.com

MySQL Transaction locking.

Alastair Grant | Tuesday 1 November 2005

Just a quick note before I forget.

Holding open a transaction in MySQL with the InnoDB engine (the standard doesn't support specific transactions) won't lock the table to read.

Using SQL Server you would expect to find everybody else locking if you open a transaction and update a table. This would stay in place until you either commit or rollback. By the looks of things in MySQL this is not the case. All other sessions will read the current committed data and ignore the changes being made until the transaction has been committed.

I believe this can be changed either on a session level, or on the server level.

Handy to know though when writing web-sites...

Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.