src/Leevel/Database/Connect.php
public function beginTransaction(): void
    {
        $this->transactionLevel++;

        if (1 === $this->transactionLevel) {
            try { // @codeCoverageIgnore
                $this->pdo(true)->beginTransaction();
            } catch (Exception $e) { // @codeCoverageIgnore
                $this->transactionLevel--; // @codeCoverageIgnore

                throw $e; // @codeCoverageIgnore
            } // @codeCoverageIgnore
        } elseif ($this->transactionLevel > 1 && $this->hasSavepoints()) {
            $this->createSavepoint($this->getSavepointName());
        }
    }
public function beginTransaction(): void
    {
        $this->transactionLevel++;

        if (1 === $this->transactionLevel) {
            try { // @codeCoverageIgnore
                $this->pdo(true)->beginTransaction();
            } catch (Exception $e) { // @codeCoverageIgnore
                $this->transactionLevel--; // @codeCoverageIgnore

                throw $e; // @codeCoverageIgnore
            } // @codeCoverageIgnore
        } elseif ($this->transactionLevel > 1 && $this->hasSavepoints()) {
            $this->createSavepoint($this->getSavepointName());
        }
    }
启动事务.