Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
7a98515b
Commit
7a98515b
authored
16 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Add option to add log info in commit and rollback functions
parent
6493af16
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/lib/databases/mysql.lib.php
+12
-10
12 additions, 10 deletions
htdocs/lib/databases/mysql.lib.php
htdocs/lib/databases/mysqli.lib.php
+10
-8
10 additions, 8 deletions
htdocs/lib/databases/mysqli.lib.php
with
22 additions
and
18 deletions
htdocs/lib/databases/mysql.lib.php
+
12
−
10
View file @
7a98515b
...
@@ -299,10 +299,11 @@ class DoliDb
...
@@ -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
...
@@ -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
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
htdocs/lib/databases/mysqli.lib.php
+
10
−
8
View file @
7a98515b
...
@@ -305,10 +305,11 @@ class DoliDb
...
@@ -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
...
@@ -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
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment