From: Ralph H. <rh...@ce...> - 2002-04-10 01:17:45
|
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 |
From: Harri P. <har...@tr...> - 2002-04-10 01:34:46
|
On Tue, 09 Apr 2002 10:13:34 +0200 Ralph Heinkel <rh...@ce...> 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 |
From: Dave C. <dj...@ob...> - 2002-04-13 19:44:42
|
>>>>> "Harri" == Harri Pasanen <har...@tr...> writes: Harri> I presume you are seeing the message in the exception handler Harri> for Sybase.Error ? Harri> If you can, you could try closing the open cursors, call Harri> db.commit() and then restart the operations. Harri> Calling db.commit() in general seems to be a good idea for the Harri> Sybase module (v0.34). I rearranged my code to call Harri> db.commit() before calling stored procedures, otherwise those Harri> calls sometimes silently failed producing wrong results, Harri> without throwing any exceptions. The missing exception is a bug but requiring a commit() is correct behaviour. The DB-API specification says that in the documentation for the Connection.commit() method: Commit any pending transaction to the database. Note that if the database supports an auto-commit feature, this must be initially off. You can have the ISQL like behaviour by doing this: db = Sybase.connect('SYBASE', user = 'sa', passwd = '', auto_commit = 1) - Dave -- http://www.object-craft.com.au |
From: Ralph H. <he...@ce...> - 2002-05-29 06:23:14
|
Hello, some time ago in april I've once sent a mail to this group. However I still do not get things to run properly. I have tried to following code with python2.2 on Linux, Sybase 11.9.2, with python-sybase adapter V0.34 and V0.35pre2. Both fail with slightly different messages. What I actually want to do is just to close the cursor c1, open a new cursor c2 and then run the correct SQL there. But this also fails which is why I tried to do what Harri Pasanen suggested - unfortunately without success. Any ideas? Ralph --------------------------------------------------------- import Sybase db = Sybase.connect('monkey', 'cenix_admin', 'blabli1', 'cenix_lab') c1 = db.cursor() try: # produce an error - THE TABLE 'DUMMY' DOES NOT EXIST c1.execute('select * from dummy') except: print 'select failed' c1.close() db.commit() Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 603, in commit self.execute('commit transaction') File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 633, in execute self._raise_error(Error, 'ct_send') File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 525, in _raise_error raise exc(text) Sybase.Error: ct_send Layer: 1, Origin: 1 ct_cmd_drop(): user api layer: external error: This routine can be called only if the command structure is idle. Layer: 1, Origin: 1 ct_send(): user api layer: external error: This routine cannot be called because another command structure has results pending. Harri Pasanen wrote: > On Tue, 09 Apr 2002 10:13:34 +0200 Ralph Heinkel <rh...@ce...> 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 > > -- ------------------------------------------------------------------ Ralph Heinkel Cenix Bioscience GmbH IT-Unit Director Tel : +49 351 210 2548 Pfotenhauerstr. 108 Fax : +49 351 210 1309 01307 Dresden, Germany eMail: he...@ce... |
From: Dave C. <dj...@ob...> - 2002-05-30 06:39:08
|
> Hello, some time ago in april I've once sent a mail to this > group. However I still do not get things to run properly. I have > tried to following code with python2.2 on Linux, Sybase 11.9.2, with > python-sybase adapter V0.34 and V0.35pre2. Both fail with slightly > different messages. What I actually want to do is just to close the > cursor c1, open a new cursor c2 and then run the correct SQL > there. But this also fails which is why I tried to do what Harri > Pasanen suggested - unfortunately without success. Any ideas? One thing which would really help would be to insert the following line after import Sybase: Sybase._ctx.debug = 1 This will turn on quite a lot of debugging which should help me pinpoint what is going wrong. > --------------------------------------------------------- > import Sybase > > db = Sybase.connect('monkey', 'cenix_admin', 'blabli1', 'cenix_lab') > c1 = db.cursor() > try: > # produce an error - THE TABLE 'DUMMY' DOES NOT EXIST > c1.execute('select * from dummy') > except: > print 'select failed' > > c1.close() > db.commit() > > Traceback (most recent call last): > File "<stdin>", line 1, in ? > File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 603, > in commit > self.execute('commit transaction') > File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 633, > in execute > self._raise_error(Error, 'ct_send') > File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 525, > in _raise_error > raise exc(text) > Sybase.Error: ct_send > Layer: 1, Origin: 1 > ct_cmd_drop(): user api layer: external error: This routine can be > called only if the command > structure is idle. > Layer: 1, Origin: 1 > ct_send(): user api layer: external error: This routine cannot be > called because another command structure has results pending. - Dave -- http://www.object-craft.com.au |