{"record":{"id":"fe9cf27c23deadc8","repo":"phalcon/cphalcon","slug":"selectreadconnection-did-not-return-a-connection","errorCode":null,"errorMessage":"selectReadConnection did not return a connection","messagePattern":"selectReadConnection did not return a connection","errorType":"exception","errorClass":"ReadConnectionMissing","httpStatus":null,"severity":"error","filePath":"phalcon/Mvc/Model/Query.zep","lineNumber":3344,"sourceCode":"    {\n        var connection = null, transaction;\n\n        let transaction = this->transaction;\n\n        if typeof transaction == \"object\" && transaction instanceof TransactionInterface {\n            return transaction->getConnection();\n        }\n\n        if method_exists(model, \"selectReadConnection\") {\n            // use selectReadConnection() if implemented in extended Model class\n            let connection = model->selectReadConnection(\n                intermediate,\n                bindParams,\n                bindTypes\n            );\n\n            if unlikely typeof connection != \"object\" {\n                throw new ReadConnectionMissing();\n            }\n\n            return connection;\n        }\n\n        return model->getReadConnection();\n    }\n\n    /**\n     * Query the records on which the UPDATE/DELETE operation will be done\n     *\n     * @return ResultsetInterface\n     */\n    final protected function getRelatedRecords(<ModelInterface> model, array intermediate, array bindParams, array bindTypes) -> <ResultsetInterface>\n    {\n        var selectIr, joinConditions, whereConditions, limitConditions, query;\n\n        /**","sourceCodeStart":3326,"sourceCodeEnd":3362,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Mvc/Model/Query.zep#L3326-L3362","documentation":"Error \"selectReadConnection did not return a connection\" thrown in phalcon/cphalcon.","triggerScenarios":"Thrown at phalcon/Mvc/Model/Query.zep:3344 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":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}