On Dec 23, 2010, at 2:09 PM, Hector Blanco wrote:

> Hello everyone!
> 
> I am currently working with a webserver (Grok) that starts different
> threads (automatically) for the requests that arrive to it.
> 
> The information is serialized in a MySQL database (which is acceded
> through SqlAlchemy). The users' information is stored in that MySQL
> database. The plugin that said server uses to check if a user is
> logged in or not is called very often. The way it is programmed now
> (I'll improve that in the future) is: it goes to the database, tries
> to extract the user whose "username" matches with the logged (or the
> one trying to log) one and checks if the password stored in the
> database matches with the one provided by the user.
> 
> For some reason, if a user cancels the login process (hits Esc in his
> browser) and tries to login again, something (I don't know what)
> crashes:
> 
> 2010-12-23 13:45:50,841 WARNING [sqlalchemy.pool.QueuePool.0x...5450]
> Error closing cursor: (2014, "Commands out of sync; you can't run this
> command now")

If connection resources are returned to the pool via garbage collection, this 
may happen in a distinct, deferred gc thread, producing errors like this.    It 
is common for web app servers to throw some kind of interruption exception when 
the connection is unexpectedly closed.   The error is caught and logged as a 
warning only and should be otherwise harmless.  If you could apply a "finally:" 
block around connection interruption errors and cleanly close the session, that 
would probably alleviate the warnings.


-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to