On Feb 12, 2008 4:21 AM, Nathan Edwards <[EMAIL PROTECTED]> wrote:
> The MySQLdb error:
>
>     Exception _mysql_exceptions.ProgrammingError: (2014, "Commands out of
>     sync; you can't run this command now") in <bound method
>     Cursor.__del__ of <MySQLdb.cursors.Cursor object at 0x2a99c68ad0>>
>     ignored
>
> is pretty consistent, and sometimes I get an "InterfaceError" from
> sqlobject.

>From the mysqldb Documentation:

     The MySQL protocol can not handle multiple threads using the
      same connection at once. Some earlier versions of MySQLdb
      utilized locking to achieve a threadsafety of 2. While this is
      not terribly hard to accomplish using the standard Cursor class
      (which uses ``mysql_store_result()``), it is complicated by
      SSCursor (which uses ``mysql_use_result()``; with the latter you
      must ensure all the rows have been read before another query can
      be executed.

So mysql connections need to be managed in the same why as is
currently done for sqlite, which also doesn't allow conenctions to be
shared across threads.

I've added a quick patch to do this, based of the logic in
sqliteconnection, to the sourceforge issue tracker (# 1894909), which
fixes the issue for me.

-- 
Neil Muller

I've got a gmail account. Why haven't I become cool?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to