Skip to content

Commit f62ff51

Browse files
Merge remote-tracking branch 'upstream/main' into var_object
2 parents e2768d9 + a83997d commit f62ff51

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
@@ -88,16 +88,18 @@ public function commitTransaction(): bool
8888
{
8989
if ($this->inTransaction === 0) {
9090
return false;
91-
} elseif ($this->inTransaction > 1) {
92-
$this->inTransaction--;
93-
return true;
9491
}
9592

9693
if (!$this->getPDO()->inTransaction()) {
9794
$this->inTransaction = 0;
9895
return false;
9996
}
10097

98+
if ($this->inTransaction > 1) {
99+
$this->inTransaction--;
100+
return true;
101+
}
102+
101103
try {
102104
$result = $this->getPDO()->commit();
103105
$this->inTransaction = 0;
@@ -130,6 +132,7 @@ public function rollbackTransaction(): bool
130132
$this->inTransaction = 0;
131133
}
132134
} catch (PDOException $e) {
135+
$this->inTransaction = 0;
133136
throw new DatabaseException('Failed to rollback transaction: ' . $e->getMessage(), $e->getCode(), $e);
134137
}
135138

@@ -153,6 +156,7 @@ public function ping(): bool
153156
public function reconnect(): void
154157
{
155158
$this->getPDO()->reconnect();
159+
$this->inTransaction = 0;
156160
}
157161

158162
/**

0 commit comments

Comments
 (0)