Re: Invalid cursor state

Dan Fairs <[email protected]>
Newsgroups gmane.comp.python.egenix.user
Message-ID <[email protected]>
>>
>> - Cause a row to be SELECTed from a table
>> - UPDATE the same row
>> - SELECT that same row again
>
> Are you using the ZSQL method from different threads ?
>

No, these are in the same request; therefore the same thread.

> I assume you are running the UPDATE using a different ZSQL method,
> right ?

That's correct.

(We do have ZSQL methods that do an UPDATE and then immediately SELECT  
the newly-updated data out, incidentally; however, the case I'm  
talking about here doesn't do that. Splitting those up was one of the  
stages in our investigation.)

>
> It is possible that the ODBC driver tries to do some optimization
> by keeping the result set and the cursor from the first SELECT
> alive even after the Zope DA has closed it.
>
> This would explain the invalid cursor state, since SQL Server
> does not support multiple active statements on the same connection
> unless you enable the MARS feature available in SQL Server 2005
> and later:
>
> http://msdn.microsoft.com/en-us/library/ms131686.aspx
>
> (you can enable this via a connection parameter "Mars_Connection=on")
>

Ah - now that's interesting. Now you mention it, I do remember MARS  
from my .NET days. Unfortunately the client's servers are only running  
SQL Server 2000; however, we've got 2005 and 2008 dev instances here,  
so we'll try it on those and see if does resolve the issue.

Thanks
Dan

--
Dan Fairs <[email protected]> | http://www.fezconsulting.com/


_______________________________________________________________________
eGenix.com User Mailing List                     http://www.egenix.com/
https://www.egenix.com/mailman/listinfo/egenix-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.