File tree Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Expand file tree Collapse file tree 2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -1283,16 +1283,17 @@ public function transactional(Closure $func)
1283
1283
1284
1284
try {
1285
1285
$ res = $ func ($ this );
1286
- $ this ->commit ();
1287
1286
1288
1287
$ successful = true ;
1289
-
1290
- return $ res ;
1291
1288
} finally {
1292
1289
if (! $ successful ) {
1293
1290
$ this ->rollBack ();
1294
1291
}
1295
1292
}
1293
+
1294
+ $ this ->commit ();
1295
+
1296
+ return $ res ;
1296
1297
}
1297
1298
1298
1299
/**
@@ -1424,12 +1425,21 @@ public function commit()
1424
1425
1425
1426
$ connection = $ this ->getWrappedConnection ();
1426
1427
1427
- if ($ this ->transactionNestingLevel === 1 ) {
1428
- $ result = $ this ->doCommit ($ connection );
1429
- } elseif ($ this ->nestTransactionsWithSavepoints ) {
1430
- $ this ->releaseSavepoint ($ this ->_getNestedTransactionSavePointName ());
1428
+ try {
1429
+ if ($ this ->transactionNestingLevel === 1 ) {
1430
+ $ result = $ this ->doCommit ($ connection );
1431
+ } elseif ($ this ->nestTransactionsWithSavepoints ) {
1432
+ $ this ->releaseSavepoint ($ this ->_getNestedTransactionSavePointName ());
1433
+ }
1434
+ } finally {
1435
+ $ this ->updateTransactionStateAfterCommit ();
1431
1436
}
1432
1437
1438
+ return $ result ;
1439
+ }
1440
+
1441
+ private function updateTransactionStateAfterCommit (): void
1442
+ {
1433
1443
--$ this ->transactionNestingLevel ;
1434
1444
1435
1445
$ eventManager = $ this ->getEventManager ();
@@ -1446,12 +1456,10 @@ public function commit()
1446
1456
}
1447
1457
1448
1458
if ($ this ->autoCommit !== false || $ this ->transactionNestingLevel !== 0 ) {
1449
- return $ result ;
1459
+ return ;
1450
1460
}
1451
1461
1452
1462
$ this ->beginTransaction ();
1453
-
1454
- return $ result ;
1455
1463
}
1456
1464
1457
1465
/**
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ public function beginTransaction(): bool
142
142
143
143
public function commit (): bool
144
144
{
145
- if (! oci_commit ($ this ->connection )) {
145
+ if (! @ oci_commit ($ this ->connection )) {
146
146
throw Error::new ($ this ->connection );
147
147
}
148
148
You can’t perform that action at this time.
0 commit comments