Skip to content

Commit b2f9cc8

Browse files
authored
Merge branch 'main' into feat-operators
2 parents 384f993 + a83997d commit b2f9cc8

File tree

3 files changed

+102
-100
lines changed

3 files changed

+102
-100
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"ext-pdo": "*",
3838
"ext-mongodb": "*",
3939
"ext-mbstring": "*",
40-
"utopia-php/validators": "0.0.*",
40+
"utopia-php/framework": "0.33.*",
4141
"utopia-php/cache": "0.13.*",
4242
"utopia-php/pools": "0.8.*",
4343
"utopia-php/mongo": "0.11.*"

composer.lock

Lines changed: 94 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Database/Adapter/SQL.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,18 @@ public function commitTransaction(): bool
9595
{
9696
if ($this->inTransaction === 0) {
9797
return false;
98-
} elseif ($this->inTransaction > 1) {
99-
$this->inTransaction--;
100-
return true;
10198
}
10299

103100
if (!$this->getPDO()->inTransaction()) {
104101
$this->inTransaction = 0;
105102
return false;
106103
}
107104

105+
if ($this->inTransaction > 1) {
106+
$this->inTransaction--;
107+
return true;
108+
}
109+
108110
try {
109111
$result = $this->getPDO()->commit();
110112
$this->inTransaction = 0;
@@ -137,6 +139,7 @@ public function rollbackTransaction(): bool
137139
$this->inTransaction = 0;
138140
}
139141
} catch (PDOException $e) {
142+
$this->inTransaction = 0;
140143
throw new DatabaseException('Failed to rollback transaction: ' . $e->getMessage(), $e->getCode(), $e);
141144
}
142145

@@ -160,6 +163,7 @@ public function ping(): bool
160163
public function reconnect(): void
161164
{
162165
$this->getPDO()->reconnect();
166+
$this->inTransaction = 0;
163167
}
164168

165169
/**

0 commit comments

Comments
 (0)