Enhancement for postgresql support

This commit is contained in:
Laurent Destailleur
2010-04-30 18:00:39 +00:00
parent 054572fa12
commit 22382756d1
3 changed files with 17 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
@@ -479,7 +479,7 @@ class DoliDb
else $loop=false;
}
if ($usesavepoint)
if ($usesavepoint && $this->transaction_opened)
{
@pg_query($this->db, 'SAVEPOINT mysavepoint');
}
@@ -497,7 +497,7 @@ class DoliDb
//print "\n>> ".$query."<br>\n";
//print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."<br>\n";
if ($usesavepoint)
if ($usesavepoint && $this->transaction_opened)
{
@pg_query($this->db, 'ROLLBACK TO SAVEPOINT mysavepoint');
}