phalcon/cphalcon · error · ReadConnectionMissing

selectReadConnection did not return a connection

Error message

selectReadConnection did not return a connection

What it means

Error "selectReadConnection did not return a connection" thrown in phalcon/cphalcon.

Source

Thrown at phalcon/Mvc/Model/Query.zep:3344

    {
        var connection = null, transaction;

        let transaction = this->transaction;

        if typeof transaction == "object" && transaction instanceof TransactionInterface {
            return transaction->getConnection();
        }

        if method_exists(model, "selectReadConnection") {
            // use selectReadConnection() if implemented in extended Model class
            let connection = model->selectReadConnection(
                intermediate,
                bindParams,
                bindTypes
            );

            if unlikely typeof connection != "object" {
                throw new ReadConnectionMissing();
            }

            return connection;
        }

        return model->getReadConnection();
    }

    /**
     * Query the records on which the UPDATE/DELETE operation will be done
     *
     * @return ResultsetInterface
     */
    final protected function getRelatedRecords(<ModelInterface> model, array intermediate, array bindParams, array bindTypes) -> <ResultsetInterface>
    {
        var selectIr, joinConditions, whereConditions, limitConditions, query;

        /**

View on GitHub (pinned to b7419de9cd)

When it happens

Trigger: Thrown at phalcon/Mvc/Model/Query.zep:3344 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21). Data as JSON: /api/errors/fe9cf27c23deadc8. Report an issue: GitHub.