{"record":{"id":"9c7106b6b1374358","repo":"yiisoft/yii2","slug":"transaction-not-started-nested-transaction-not-su","errorCode":null,"errorMessage":"Transaction not started: nested transaction not supported.","messagePattern":"Transaction not started: nested transaction not supported\\.","errorType":"exception","errorClass":"yii\\base\\NotSupportedException","httpStatus":null,"severity":"error","filePath":"framework/db/Transaction.php","lineNumber":148,"sourceCode":"            Yii::debug('Begin transaction' . ($isolationLevel ? ' with isolation level ' . $isolationLevel : ''), __METHOD__);\n\n            $this->db->trigger(Connection::EVENT_BEGIN_TRANSACTION);\n            $this->db->pdo->beginTransaction();\n            $this->_level = 1;\n\n            return;\n        }\n\n        $schema = $this->db->getSchema();\n        if ($schema->supportsSavepoint()) {\n            Yii::debug('Set savepoint ' . $this->_level, __METHOD__);\n            // make sure the transaction wasn't autocommitted\n            if ($this->db->pdo->inTransaction()) {\n                $schema->createSavepoint('LEVEL' . $this->_level);\n            }\n        } else {\n            Yii::info('Transaction not started: nested transaction not supported', __METHOD__);\n            throw new NotSupportedException('Transaction not started: nested transaction not supported.');\n        }\n        $this->_level++;\n    }\n\n    /**\n     * Commits a transaction.\n     * @throws Exception if the transaction is not active\n     */\n    public function commit()\n    {\n        if (!$this->getIsActive()) {\n            throw new Exception('Failed to commit transaction: transaction was inactive.');\n        }\n\n        $this->_level--;\n        if ($this->_level === 0) {\n            Yii::debug('Commit transaction', __METHOD__);\n            // make sure the transaction wasn't autocommitted","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/Transaction.php#L130-L166","documentation":"Error \"Transaction not started: nested transaction not supported.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/Transaction.php:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"66f00d18a29b520f85e8e8f1e32d1e7e7b556cac","analyzedAt":"2026-08-17T05:17:23.470Z","schemaVersion":2},"datasetVersion":"2026-08-17T09:17:11.063Z"}