On Sunday 17 February 2008, Nathan Edwards wrote:
> >    Shouldn't that be
> > sqlhub.threadConnection = connectionForURI(connuri)
> >
> >      for i in range(1000):
> >          try:
> >              a = AAA(value=1)
> >          except dberrors.DuplicateEntryError:
> >              a = AAA.byValue(1)
>
> Can't find any documentation for sqlhub.threadConnection, but I've
> tried setting it in the main process before threads are created, and/or
> separately in each thread.
>
> I still get the occasional "Commands out of sync..." exception from
> MySQLdb.

You should set this in the main thread:

sqlhub.processConnection = connectionForURI(connuri)

then in each thread that uses db access, after it is started set

sqlhub.threadConnection = sqlhub.processConnection.getConnection()



-- 
Dan

-------------------------------------------------------------------------
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