This commit is contained in:
2023-12-12 17:47:40 +08:00
parent 9c433855d5
commit 64087d6258
+6
View File
@@ -235,6 +235,9 @@ class Connection extends Component
{ {
$this->storey--; $this->storey--;
if ($this->storey == 0) { if ($this->storey == 0) {
if (!Context::exists($this->cds)) {
return;
}
$pdo = $this->getTransactionClient(); $pdo = $this->getTransactionClient();
if ($pdo->inTransaction()) { if ($pdo->inTransaction()) {
$pdo->rollback(); $pdo->rollback();
@@ -251,6 +254,9 @@ class Connection extends Component
{ {
$this->storey--; $this->storey--;
if ($this->storey == 0) { if ($this->storey == 0) {
if (!Context::exists($this->cds)) {
return;
}
$pdo = $this->getTransactionClient(); $pdo = $this->getTransactionClient();
if ($pdo->inTransaction()) { if ($pdo->inTransaction()) {
$pdo->commit(); $pdo->commit();