Bhuwan Gautam Bhuwan Gautam - 3 months ago 16
MySQL Question

What is the default Isolation level in case of Doctrine using ZF1 and ZF2 and MySql as database?

We are using

Doctrine
as ORM, Framework
ZF1
and
ZF2
, and Database
MySql
. I know the default isolation level for
innodb
engine is
Repeatable Read
. Since I am using the
Doctrine
as ORM what is the default
isolation level
? In this document it is stated as below:


The default transaction isolation level of a Doctrine\DBAL\Connection is chosen by the underlying platform but it is always at least READ_COMMITTED.


What made me more confused was from the another article from the Doctrine itself. I this document it is stated as follow:


This could result in unpredictable results because an explicit WITH (NOLOCK) table hint tells SQL Server to run a specific query in transaction isolation level READ UNCOMMITTED instead of the default READ COMMITTED transaction isolation level. Therefore there now is a distinction between LockMode::NONE and null to be able to tell Doctrine whether to add table lock hints to queries by intention or not.


Can anyone explain what is the default isolation level for Doctrine?

Answer

For MySql the default isolation level is Repeatable Read.

For MSSql the default isolation level is Read Committed.

Unless you change the default setting of the middleware(ORM) the following statement is valid:

The default transaction isolation level of a Doctrine\DBAL\Connection is chosen by the underlying platform.

Comments