From 2eb63c6bd464a9600056180bd4d49289eee22dad Mon Sep 17 00:00:00 2001 From: whwyy Date: Tue, 12 Dec 2023 17:21:25 +0800 Subject: [PATCH] eee --- Connection.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Connection.php b/Connection.php index 2e52497..9108282 100644 --- a/Connection.php +++ b/Connection.php @@ -212,7 +212,11 @@ class Connection extends Component { $pdo = Context::get($this->cds); if ($pdo === null) { - return Context::set($this->cds, $this->getNormalClientHealth()); + /** @var PDO $pdo */ + $pdo = Context::set($this->cds, $this->getNormalClientHealth()); + if ($this->storey > 0 && !$pdo->inTransaction()) { + $pdo->beginTransaction(); + } } return $pdo; }