Skip to content

Commit

Permalink
Fix stan
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Oct 15, 2024
1 parent 78f0e9d commit efd0f4e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/Database/Adapter/SQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,20 @@ public function commitTransaction(): bool
}

if (!$this->getPDO()->inTransaction()) {
// Implicit commit occurred
$this->inTransaction = 0;
return false;
}

try {
$result = $this->getPDO()->commit();
} catch (PDOException $e) {
if ($this->getPDO()->inTransaction()) {
$this->getPDO()->rollBack();
}
throw new DatabaseException('Failed to commit transaction: ' . $e->getMessage(), $e->getCode(), $e);
} finally {
$this->inTransaction--;
}

if (!$result) {
if ($this->getPDO()->inTransaction()) {
$this->getPDO()->rollBack();
}
throw new DatabaseException('Failed to commit transaction');
}

Expand Down

0 comments on commit efd0f4e

Please sign in to comment.