[python-sybase] problem with pending results
Harri Pasanen
harri.pasanen at trema.com
Tue, 9 Apr 2002 10:34:23 +0200 (CEST)
On Tue, 09 Apr 2002 10:13:34 +0200 Ralph Heinkel <rh@cenix-bioscience.com> wrote:
> Hello,
>
> every once in a while (especially after having sybase server problems)
> I get the following message:
>
> ['ct_send', {'status': 0, 'sqlstate': 'ZZZZZ', 'osnumber': 0,
> 'osstring': '', 'msgstring': 'ct_send(): user api layer: external error:
> This routine cannot be called because another command structure has
> results pending.', 'msgnumber': 16843057, 'severity': 1}]
>
>
> What would be the adequate reaction on this? (How do I detect this -
> the the msgnumber 16843057 unique to this error?)
>
> Thanks,
>
> Ralph
>
I presume you are seeing the message in the exception handler for
Sybase.Error ?
If you can, you could try closing the open cursors, call db.commit() and
then restart the operations.
Calling db.commit() in general seems to be a good idea for the Sybase
module (v0.34). I rearranged my code to call db.commit() before calling
stored procedures, otherwise those calls sometimes silently failed
producing wrong results, without throwing any exceptions.
-Harri