This commit is contained in:
2023-08-25 10:04:55 +08:00
parent 703300182b
commit d377deab8e
+2 -2
View File
@@ -202,7 +202,7 @@ class Connection extends Component
if ($this->storey == 0) { if ($this->storey == 0) {
/** @var PDO $pdo */ /** @var PDO $pdo */
$pdo = Context::get($this->cds, $this->getTransactionClient()); $pdo = Context::get($this->cds, $this->getTransactionClient());
if (!$this->inTransaction()) { if (!$pdo->inTransaction()) {
$pdo->beginTransaction(); $pdo->beginTransaction();
} }
} }
@@ -220,7 +220,7 @@ class Connection extends Component
$pdo = Context::get($this->cds); $pdo = Context::get($this->cds);
if ($pdo === null) { if ($pdo === null) {
$pdo = $this->getNormalClientHealth(); $pdo = $this->getNormalClientHealth();
if ($this->storey > 0 && !$this->inTransaction()) { if ($this->storey > 0 && !$pdo->inTransaction()) {
$pdo->beginTransaction(); $pdo->beginTransaction();
} }
Context::set($this->cds, $pdo); Context::set($this->cds, $pdo);