Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
372e56d3
Commit
372e56d3
authored
Mar 24, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #121 from frosas/master
Log transaction statements
parents
d9c3509e
7c15f14e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
Connection.php
lib/Doctrine/DBAL/Connection.php
+42
-0
No files found.
lib/Doctrine/DBAL/Connection.php
View file @
372e56d3
...
@@ -899,10 +899,24 @@ class Connection implements DriverConnection
...
@@ -899,10 +899,24 @@ class Connection implements DriverConnection
++
$this
->
_transactionNestingLevel
;
++
$this
->
_transactionNestingLevel
;
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$this
->
_transactionNestingLevel
==
1
)
{
if
(
$this
->
_transactionNestingLevel
==
1
)
{
if
(
$logger
)
{
$logger
->
startQuery
(
'"START TRANSACTION"'
);
}
$this
->
_conn
->
beginTransaction
();
$this
->
_conn
->
beginTransaction
();
if
(
$logger
)
{
$logger
->
stopQuery
();
}
}
else
if
(
$this
->
_nestTransactionsWithSavepoints
)
{
}
else
if
(
$this
->
_nestTransactionsWithSavepoints
)
{
if
(
$logger
)
{
$logger
->
startQuery
(
'"SAVEPOINT"'
);
}
$this
->
createSavepoint
(
$this
->
_getNestedTransactionSavePointName
());
$this
->
createSavepoint
(
$this
->
_getNestedTransactionSavePointName
());
if
(
$logger
)
{
$logger
->
stopQuery
();
}
}
}
}
}
...
@@ -924,10 +938,24 @@ class Connection implements DriverConnection
...
@@ -924,10 +938,24 @@ class Connection implements DriverConnection
$this
->
connect
();
$this
->
connect
();
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$this
->
_transactionNestingLevel
==
1
)
{
if
(
$this
->
_transactionNestingLevel
==
1
)
{
if
(
$logger
)
{
$logger
->
startQuery
(
'"COMMIT"'
);
}
$this
->
_conn
->
commit
();
$this
->
_conn
->
commit
();
if
(
$logger
)
{
$logger
->
stopQuery
();
}
}
else
if
(
$this
->
_nestTransactionsWithSavepoints
)
{
}
else
if
(
$this
->
_nestTransactionsWithSavepoints
)
{
if
(
$logger
)
{
$logger
->
startQuery
(
'"RELEASE SAVEPOINT"'
);
}
$this
->
releaseSavepoint
(
$this
->
_getNestedTransactionSavePointName
());
$this
->
releaseSavepoint
(
$this
->
_getNestedTransactionSavePointName
());
if
(
$logger
)
{
$logger
->
stopQuery
();
}
}
}
--
$this
->
_transactionNestingLevel
;
--
$this
->
_transactionNestingLevel
;
...
@@ -949,13 +977,27 @@ class Connection implements DriverConnection
...
@@ -949,13 +977,27 @@ class Connection implements DriverConnection
$this
->
connect
();
$this
->
connect
();
$logger
=
$this
->
_config
->
getSQLLogger
();
if
(
$this
->
_transactionNestingLevel
==
1
)
{
if
(
$this
->
_transactionNestingLevel
==
1
)
{
if
(
$logger
)
{
$logger
->
startQuery
(
'"ROLLBACK"'
);
}
$this
->
_transactionNestingLevel
=
0
;
$this
->
_transactionNestingLevel
=
0
;
$this
->
_conn
->
rollback
();
$this
->
_conn
->
rollback
();
$this
->
_isRollbackOnly
=
false
;
$this
->
_isRollbackOnly
=
false
;
if
(
$logger
)
{
$logger
->
stopQuery
();
}
}
else
if
(
$this
->
_nestTransactionsWithSavepoints
)
{
}
else
if
(
$this
->
_nestTransactionsWithSavepoints
)
{
if
(
$logger
)
{
$logger
->
startQuery
(
'"ROLLBACK TO SAVEPOINT"'
);
}
$this
->
rollbackSavepoint
(
$this
->
_getNestedTransactionSavePointName
());
$this
->
rollbackSavepoint
(
$this
->
_getNestedTransactionSavePointName
());
--
$this
->
_transactionNestingLevel
;
--
$this
->
_transactionNestingLevel
;
if
(
$logger
)
{
$logger
->
stopQuery
();
}
}
else
{
}
else
{
$this
->
_isRollbackOnly
=
true
;
$this
->
_isRollbackOnly
=
true
;
--
$this
->
_transactionNestingLevel
;
--
$this
->
_transactionNestingLevel
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment