From: Chris G. <ch...@il...> - 2004-03-23 07:32:01
|
"Chris Gahan" <ch...@il...> wrote in message news:c3k162$stb$1...@se...... > [...] If I hammer SQLObject > with multiple threads all doing queries simultaneously, it'll either bomb > out by giving me an exception, or permanently lock up one of the threads, > and sometimes the entire python interpreter. I've been experimenting with DBConnection.py a bit, and I still can't figure out what's causing this thread synchronization error. The code all looks kosher: + take and hold a connection from the pool + execute a query + iterate through the results using the connection's cursor + when the "sqlresult" object gets deleted, return the connection to the pool I'm still randomly getting a "Commands out of sync" error in MySQL, or an "OperationalError" exception in Postgres. The problem still seems to be that another process is getting a hold of a connection which contains a cursor that hasn't finished iterating through its results. I really need somebody to help me brainstorm causes here, because this isn't my area of expertise. :) Can anybody suggest why MySQL would think I was executing an "out-of-sync" command? Could it be that the cursor needs to be "closed" before being returned to the DB? Maybe the object is getting deleted mid-iteration, and a connection containing partially-iterated cursor is being returned to the pool? Any help at all is appreciated. :) = Chris Gahan ============= (ch...@il...) |