Commands out of sync

I’m getting this error when talking to MySQL

Status: 500 Internal Server Error
Mysql::Error: Commands out of sync; you can’t run this command now:
UPDATE sessions SET `data

This is the :active_record_store that is calling this command for the
session store.

It sounds like you are trying to run two commands at the same time and
your first command hasn’t closed the session… In otherwords, trying to
open more than one session without closing the first…

I’m running a command to retrieve some records from the DB. This error
is for the active_record_store which rails uses to manage sessions. I’m
not executing this command from my code. Also, this is not happenning
on the dev server.