From 66d5d46add8d072324e961d13e91566e26de6d54 Mon Sep 17 00:00:00 2001 From: whwyy Date: Thu, 23 Nov 2023 15:30:57 +0800 Subject: [PATCH] eee --- Connection.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Connection.php b/Connection.php index 5492149..b166a17 100644 --- a/Connection.php +++ b/Connection.php @@ -258,7 +258,9 @@ class Connection extends Component $this->storey--; if ($this->storey == 0) { $pdo = $this->getTransactionClient(); - $pdo->rollback(); + if ($pdo->inTransaction()) { + $pdo->rollback(); + } $this->release($pdo); } } @@ -272,7 +274,9 @@ class Connection extends Component $this->storey--; if ($this->storey == 0) { $pdo = $this->getTransactionClient(); - $pdo->commit(); + if ($pdo->inTransaction()) { + $pdo->commit(); + } $this->release($pdo); } }