Fix: Dans un context de transactions imbriques, le commit pouvait se faire dans un sous niveau
This commit is contained in:
parent
e904da75ba
commit
e9833091a7
@ -326,7 +326,7 @@ class DoliDb
|
||||
|
||||
function commit()
|
||||
{
|
||||
if ($this->transaction_opened==1)
|
||||
if ($this->transaction_opened<=1)
|
||||
{
|
||||
$ret=$this->query("COMMIT");
|
||||
if ($ret) $this->transaction_opened=0;
|
||||
@ -346,7 +346,7 @@ class DoliDb
|
||||
|
||||
function rollback()
|
||||
{
|
||||
if ($this->transaction_opened==1)
|
||||
if ($this->transaction_opened<=1)
|
||||
{
|
||||
$ret=$this->query("ROLLBACK");
|
||||
$this->transaction_opened=0;
|
||||
@ -354,6 +354,7 @@ class DoliDb
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->transaction_opened--;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ class DoliDb
|
||||
*/
|
||||
function commit()
|
||||
{
|
||||
if ($this->transaction_opened==1)
|
||||
if ($this->transaction_opened<=1)
|
||||
{
|
||||
$ret=$this->query("COMMIT;");
|
||||
if ($ret) $this->transaction_opened=0;
|
||||
@ -326,7 +326,7 @@ class DoliDb
|
||||
*/
|
||||
function rollback()
|
||||
{
|
||||
if ($this->transaction_opened==1)
|
||||
if ($this->transaction_opened<=1)
|
||||
{
|
||||
$ret=$this->query("ROLLBACK;");
|
||||
$this->transaction_opened=0;
|
||||
@ -334,6 +334,7 @@ class DoliDb
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->transaction_opened--;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user