[sqlalchemy] Re: ODBC Connection is busy error

2008-04-28 Thread BruceC
We're not intentionally sharing a session between multiple threads... :) I'll check out the code to see if there is any sharing going on, but I'm pretty sure that's not the case. You mention lazy-loading as if it might be playing a part in this issue - is that right? We are using lazy eager

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-28 Thread Michael Bayer
On Apr 28, 2008, at 4:04 AM, BruceC wrote: We're not intentionally sharing a session between multiple threads... :) I'll check out the code to see if there is any sharing going on, but I'm pretty sure that's not the case. You mention lazy-loading as if it might be playing a part in this

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread Esceo
Just a side note, is the pool code thread safe? i.e. no two threads would possibly checkout the same connection at any point in time? On Apr 25, 12:21 pm, Michael Bayer [EMAIL PROTECTED] wrote: only if youre leaving dangling ResultProxys opened with pending   results, which should be a fairly

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread BruceC
Hi Michael, Thanks for your persistence :) I've searched through my app, we don't seem to have any calls to fetchone(), so I'm not sure what else to look for, but I'll try to do some debugging with ResultProxys, see if that leads to any possible answers. On a side note, in our Pylons

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread Michael Bayer
On Apr 27, 2008, at 2:55 AM, Esceo wrote: Just a side note, is the pool code thread safe? i.e. no two threads would possibly checkout the same connection at any point in time? we're pretty confident its completely threadsafe as of 0.3.11, we have several different kinds of tests for its

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread Rick Morrison
What I'm not sure of at this point is if theres some cursor usage specific to the MS-SQL dialect that might be external to the ResultProxyif Rick could comb through that for me that would be helpful. The cursor is used pre_exec() if an INSERT statement tries to set a literal PK on a

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread Michael Bayer
On Apr 27, 2008, at 8:55 PM, Rick Morrison wrote: What I'm not sure of at this point is if theres some cursor usage specific to the MS-SQL dialect that might be external to the ResultProxyif Rick could comb through that for me that would be helpful. The cursor is used pre_exec()

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread Rick Morrison
It is possible we could re-introduce check for open cursors as a pool events extension. It would raise an error if any connection is returned with associated cursors still opened and could track down issues like these. That would be a great diagnostic tool for this: It's hard to track

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread BruceC
Our Pylons setup emails every traceback error to our developers, with about 80 users, we've been getting a couple of hundred error emails a day, almost all with this same error (Tomorrow we will have about 1200 users on our system). The following is an excerpt of the traceback message. Every

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread Michael Bayer
On Apr 27, 2008, at 9:58 PM, BruceC wrote: I don't know whether this helps, but many thanks for looking at the issue :) unfortunately it doesnt say much at all. You're not sharing a Session between multiple threads, right ? --~--~-~--~~~---~--~~ You

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-27 Thread Michael Bayer
On Apr 28, 2008, at 12:02 AM, Michael Bayer wrote: On Apr 27, 2008, at 9:58 PM, BruceC wrote: I don't know whether this helps, but many thanks for looking at the issue :) unfortunately it doesnt say much at all. You're not sharing a Session between multiple threads, right ? and by

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-24 Thread Paul Johnston
Hi, Since our system went live we have been getting more more errors like this: DBAPIError: (Error) ('HY000', '[HY000] [Microsoft][SQL Native Client]Connection is busy with results for another command (0)') u'SELECT ...snip valid SQL string...endsnip I've seen this error too, in fact some

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-24 Thread Rick Morrison
perhaps we could simply reset the pyodbc cursor before issuing a new SQL operation? class MSSQLExecutionContext(default.DefaultExecutionContext): def pre_exec(self): if self.dialect.clear_previous_results: self.cursor.clear_previous_results_somehow_idunnohow()

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-24 Thread Michael Bayer
On Apr 24, 2008, at 1:04 PM, Paul Johnston wrote: Hi, Since our system went live we have been getting more more errors like this: DBAPIError: (Error) ('HY000', '[HY000] [Microsoft][SQL Native Client]Connection is busy with results for another command (0)') u'SELECT ...snip valid SQL

[sqlalchemy] Re: ODBC Connection is busy error

2008-04-24 Thread BruceC
Thank you to everybody for your comments on this problem... Michael, re: your suggestion about result.close(), is this something that I could add to mssql.py, or do you think it's something that I would need to add throughout my application everytime I access the db? (It's a big application...)