From cb9e7e87757902e6f541d79b61d4de33fd19ad1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 16 Aug 2021 18:31:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Pool/Connection.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/System/Pool/Connection.php b/System/Pool/Connection.php index 8024936e..793b02d5 100644 --- a/System/Pool/Connection.php +++ b/System/Pool/Connection.php @@ -32,7 +32,11 @@ class Connection extends Component public function inTransaction($cds): bool { $name = $this->name('Mysql:' . $cds, true); - return Context::getContext('begin_' . $name) == 0; + $connection = Context::getContext($name); + if ($connection instanceof PDO) { + $connection->inTransaction(); + } + return false; } /**