Skip to content

Commit

Permalink
Fix transaction level
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Sep 27, 2022
1 parent bd48dec commit 07f914a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# CHANGELOG

v2.2.2 (in progress)
v2.2.2 (27.09.2022)
-------------------
- Fix transaction level changing on disconnect when transaction is staring by @roxblnfk (#76)

v2.2.1 (02.07.2022)
-------------------
Expand Down
1 change: 1 addition & 0 deletions src/Driver/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ public function beginTransaction(string $isolationLevel = null): bool
$this->disconnect();

try {
$this->transactionLevel = 1;
return $this->getPDO()->beginTransaction();
} catch (Throwable $e) {
$this->transactionLevel = 0;
Expand Down
1 change: 1 addition & 0 deletions src/Driver/Postgres/PostgresDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public function beginTransaction(string $isolationLevel = null): bool
$this->disconnect();

try {
$this->transactionLevel = 1;
return $this->getPDO()->beginTransaction();
} catch (Throwable $e) {
$this->transactionLevel = 0;
Expand Down

0 comments on commit 07f914a

Please sign in to comment.