{"record":{"id":"c70f1dfad9ba7d8b","repo":"yiisoft/yii2","slug":"db-connection-is-not-active","errorCode":null,"errorMessage":"DB Connection is not active.","messagePattern":"DB Connection is not active\\.","errorType":"exception","errorClass":"yii\\base\\InvalidCallException","httpStatus":null,"severity":"error","filePath":"framework/db/Schema.php","lineNumber":373,"sourceCode":"    public function findUniqueIndexes($table)\n    {\n        throw new NotSupportedException(get_class($this) . ' does not support getting unique indexes information.');\n    }\n\n    /**\n     * Returns the ID of the last inserted row or sequence value.\n     * @param string $sequenceName name of the sequence object (required by some DBMS)\n     * @return string the row ID of the last row inserted, or the last value retrieved from the sequence object\n     * @throws InvalidCallException if the DB connection is not active\n     * @see https://www.php.net/manual/en/function.PDO-lastInsertId.php\n     */\n    public function getLastInsertID($sequenceName = '')\n    {\n        if ($this->db->isActive) {\n            return $this->db->pdo->lastInsertId($sequenceName === '' ? null : $this->quoteTableName($sequenceName));\n        }\n\n        throw new InvalidCallException('DB Connection is not active.');\n    }\n\n    /**\n     * @return bool whether this DBMS supports [savepoint](https://en.wikipedia.org/wiki/Savepoint).\n     */\n    public function supportsSavepoint()\n    {\n        return $this->db->enableSavepoint;\n    }\n\n    /**\n     * Creates a new savepoint.\n     * @param string $name the savepoint name\n     */\n    public function createSavepoint($name)\n    {\n        $this->db->createCommand(\"SAVEPOINT $name\")->execute();\n    }","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/yiisoft/yii2/blob/66f00d18a29b520f85e8e8f1e32d1e7e7b556cac/framework/db/Schema.php#L355-L391","documentation":"Error \"DB Connection is not active.\" thrown in yiisoft/yii2.","triggerScenarios":"Thrown at framework/db/Schema.php:373 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"}