@@ -1336,27 +1336,10 @@ public function commit()
1336
1336
1337
1337
$ connection = $ this ->getWrappedConnection ();
1338
1338
1339
- $ logger = $ this ->_config ->getSQLLogger ();
1340
-
1341
1339
if ($ this ->transactionNestingLevel === 1 ) {
1342
- if ($ logger !== null ) {
1343
- $ logger ->startQuery ('"COMMIT" ' );
1344
- }
1345
-
1346
- $ result = $ connection ->commit ();
1347
-
1348
- if ($ logger !== null ) {
1349
- $ logger ->stopQuery ();
1350
- }
1340
+ $ result = $ this ->doCommit ($ connection );
1351
1341
} elseif ($ this ->nestTransactionsWithSavepoints ) {
1352
- if ($ logger !== null ) {
1353
- $ logger ->startQuery ('"RELEASE SAVEPOINT" ' );
1354
- }
1355
-
1356
1342
$ this ->releaseSavepoint ($ this ->_getNestedTransactionSavePointName ());
1357
- if ($ logger !== null ) {
1358
- $ logger ->stopQuery ();
1359
- }
1360
1343
}
1361
1344
1362
1345
--$ this ->transactionNestingLevel ;
@@ -1372,6 +1355,28 @@ public function commit()
1372
1355
return $ result ;
1373
1356
}
1374
1357
1358
+ /**
1359
+ * @return bool
1360
+ *
1361
+ * @throws DriverException
1362
+ */
1363
+ private function doCommit (DriverConnection $ connection )
1364
+ {
1365
+ $ logger = $ this ->_config ->getSQLLogger ();
1366
+
1367
+ if ($ logger !== null ) {
1368
+ $ logger ->startQuery ('"COMMIT" ' );
1369
+ }
1370
+
1371
+ $ result = $ connection ->commit ();
1372
+
1373
+ if ($ logger !== null ) {
1374
+ $ logger ->stopQuery ();
1375
+ }
1376
+
1377
+ return $ result ;
1378
+ }
1379
+
1375
1380
/**
1376
1381
* Commits all current nesting transactions.
1377
1382
*
@@ -1475,17 +1480,33 @@ public function createSavepoint($savepoint)
1475
1480
*/
1476
1481
public function releaseSavepoint ($ savepoint )
1477
1482
{
1483
+ $ logger = $ this ->_config ->getSQLLogger ();
1484
+
1478
1485
$ platform = $ this ->getDatabasePlatform ();
1479
1486
1480
1487
if (! $ platform ->supportsSavepoints ()) {
1481
1488
throw ConnectionException::savepointsNotSupported ();
1482
1489
}
1483
1490
1484
1491
if (! $ platform ->supportsReleaseSavepoints ()) {
1492
+ if ($ logger !== null ) {
1493
+ $ logger ->stopQuery ();
1494
+ }
1495
+
1485
1496
return ;
1486
1497
}
1487
1498
1499
+ if ($ logger !== null ) {
1500
+ $ logger ->startQuery ('"RELEASE SAVEPOINT" ' );
1501
+ }
1502
+
1488
1503
$ this ->executeStatement ($ platform ->releaseSavePoint ($ savepoint ));
1504
+
1505
+ if ($ logger === null ) {
1506
+ return ;
1507
+ }
1508
+
1509
+ $ logger ->stopQuery ();
1489
1510
}
1490
1511
1491
1512
/**
0 commit comments