mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-16 22:41:30 +01:00
Add option to add log info in commit and rollback functions
This commit is contained in:
@@ -299,10 +299,11 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Validation d'une transaction
|
* \brief Validation d'une transaction
|
||||||
\return int 1 si validation ok ou niveau de transaction non ouverte, 0 en cas d'erreur
|
* \param log Add more log to default log line
|
||||||
|
* \return int 1 si validation ok ou niveau de transaction non ouverte, 0 en cas d'erreur
|
||||||
*/
|
*/
|
||||||
function commit()
|
function commit($log='')
|
||||||
{
|
{
|
||||||
if ($this->transaction_opened<=1)
|
if ($this->transaction_opened<=1)
|
||||||
{
|
{
|
||||||
@@ -310,7 +311,7 @@ class DoliDb
|
|||||||
if ($ret)
|
if ($ret)
|
||||||
{
|
{
|
||||||
$this->transaction_opened=0;
|
$this->transaction_opened=0;
|
||||||
dolibarr_syslog("COMMIT Transaction",LOG_DEBUG);
|
dolibarr_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@@ -322,16 +323,17 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Annulation d'une transaction et retour aux anciennes valeurs
|
* \brief Annulation d'une transaction et retour aux anciennes valeurs
|
||||||
\return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
|
* \param log Add more log to default log line
|
||||||
|
* \return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
|
||||||
*/
|
*/
|
||||||
function rollback()
|
function rollback($log='')
|
||||||
{
|
{
|
||||||
if ($this->transaction_opened<=1)
|
if ($this->transaction_opened<=1)
|
||||||
{
|
{
|
||||||
$ret=$this->query("ROLLBACK");
|
$ret=$this->query("ROLLBACK");
|
||||||
$this->transaction_opened=0;
|
$this->transaction_opened=0;
|
||||||
dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
|
dolibarr_syslog("ROLLBACK Transaction".($log?' '.$log:''),LOG_DEBUG);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -305,10 +305,11 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Validation d'une transaction
|
* \brief Validation d'une transaction
|
||||||
\return int 1 si validation ok ou niveau de transaction non ouverte, 0 en cas d'erreur
|
* \param log Add more log to default log line
|
||||||
|
* \return int 1 si validation ok ou niveau de transaction non ouverte, 0 en cas d'erreur
|
||||||
*/
|
*/
|
||||||
function commit()
|
function commit($log='')
|
||||||
{
|
{
|
||||||
if ($this->transaction_opened<=1)
|
if ($this->transaction_opened<=1)
|
||||||
{
|
{
|
||||||
@@ -316,7 +317,7 @@ class DoliDb
|
|||||||
if ($ret)
|
if ($ret)
|
||||||
{
|
{
|
||||||
$this->transaction_opened=0;
|
$this->transaction_opened=0;
|
||||||
dolibarr_syslog("COMMIT Transaction",LOG_DEBUG);
|
dolibarr_syslog("COMMIT Transaction".($log?' '.$log:''),LOG_DEBUG);
|
||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@@ -328,16 +329,17 @@ class DoliDb
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Annulation d'une transaction et retour aux anciennes valeurs
|
* \brief Annulation d'une transaction et retour aux anciennes valeurs
|
||||||
\return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
|
* \param log Add more log to default log line
|
||||||
|
* \return int 1 si annulation ok ou transaction non ouverte, 0 en cas d'erreur
|
||||||
*/
|
*/
|
||||||
function rollback()
|
function rollback($log='')
|
||||||
{
|
{
|
||||||
if ($this->transaction_opened<=1)
|
if ($this->transaction_opened<=1)
|
||||||
{
|
{
|
||||||
$ret=$this->query("ROLLBACK");
|
$ret=$this->query("ROLLBACK");
|
||||||
$this->transaction_opened=0;
|
$this->transaction_opened=0;
|
||||||
dolibarr_syslog("ROLLBACK Transaction",LOG_DEBUG);
|
dolibarr_syslog("ROLLBACK Transaction".($log?' '.$log:''),LOG_DEBUG);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user