Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter's Approach to Transactions Isolation levels
#1

[eluser]Unknown[/eluser]
Hi

Someone can tell me what level of Isolation is used by default for example:

$this->db->trans_start();
$this->db->query('AN SQL QUERY...');
$this->db->query('ANOTHER QUERY...');
$this->db->query('AND YET ANOTHER QUERY...');
$this->db->trans_complete();

And how cam it be customized.

In mind that the isolation available in mysql are:
REPEATABLE READ
| READ COMMITTED
| READ UNCOMMITTED
| SERIALIZABLE

Thanks
#2

[eluser]Unknown[/eluser]
You should consider looking at the problem from a different approach and do, before anything a sql query:
SET [GLOBAL | SESSION] TRANSACTION ISOLATION LEVEL
{
REPEATABLE READ
| READ COMMITTED
| READ UNCOMMITTED
| SERIALIZABLE
}
#3

[eluser]Unknown[/eluser]
Thanks Nuno.

I tried the solution and had no errors.
Is this the best implementation?

$this->db->query("SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE");
$this->db->trans_start();

Work....

$this->db->trans_complete();




Theme © iAndrew 2016 - Forum software by © MyBB