How to Setting the MySQL transaction isolation level

youyoums

Verified User
Joined
Jul 21, 2011
Messages
37
The default transaction isolation level for MySQL, MariaDB, and equivalent databases is "REPEATABLE READ". This setting with Drupal can result in deadlocks on tables, resulting in the site becoming very slow or not responding at all.For the best performance and to minimize locking issues, the READ-COMMITTED transaction isolation level is recommended. so how to SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED?
 
transaction-isolation=read-committed
in my.cnf, which can be in /etc or some subfolder in /etc
 
this can also be done in your web application to add query for SET current session like this

Code:
$db->query("SET SESSION TRANSACTION ISOLATION LEVEL READ-COMMITTED");
 
Back
Top