Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Update Transaction.php
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfy-j authored Jan 30, 2019
1 parent 59fb4c2 commit f7a6f0a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions source/Spiral/ORM/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,13 @@ public function run(bool $forceTransaction = false, bool $clean = true)
$executedCommands[] = $command;
}
} catch (\Throwable $e) {
foreach (array_reverse($wrappedDrivers) as $driver) {
/** @var Driver $driver */
$driver->rollbackTransaction();
try {
foreach (array_reverse($wrappedDrivers) as $driver) {
/** @var Driver $driver */
$driver->rollbackTransaction();
}
} catch (\Throwable $et) {
throw $e;
}

foreach (array_reverse($executedCommands) as $command) {
Expand Down

0 comments on commit f7a6f0a

Please sign in to comment.