Welcome Guest, Not a member yet? Register   Sign In
Nested Transactions in MySQL database does not work (possible bug fix included)
#3

[eluser]Unknown[/eluser]
Thanks for posting this fix. I haven't tried it out but it makes total sense. I think you also need to add the line to set the depth=0 after a rollback was executed at the top nested level (depth=1);

function trans_rollback()
{
if ( ! $this->trans_enabled)
{
return TRUE;
}

// When transactions are nested we only begin/commit/rollback the outermost ones
if ($this->_trans_depth > 1)
{
return TRUE;
}

$this->simple_query('ROLLBACK');
$this->simple_query('SET AUTOCOMMIT=1');
$this->_trans_depth=0; //line updated
return TRUE;
}


Messages In This Thread
Nested Transactions in MySQL database does not work (possible bug fix included) - by El Forum - 09-04-2008, 03:37 AM



Theme © iAndrew 2016 - Forum software by © MyBB