When I do a query with isql I get the following message and the query blocks.
The transaction log in database foo is almost full. Your transaction is being suspended until space is made available in the log.
When I do the same from Python:
cursor.execute(sql)
The query blocks, but I would like see this message.
I tried:
Sybase.set_debug(sys.stderr)
connection.debug = 1
I’m using:
- python-sybase-0.40pre1
- Adaptive Server Enterprise/15.5/EBF 18164
EDIT: The question is, “How do I capture this warning message in the python program?”
Good question and I’m not sure I can completely answer it. Here are some ideas.
Sybase.py uses logging. Make sure you are using it. To “bump” the logging out I would do this:
And apparently (why is beyond me??) to get this working in Sybase.py you need to set a global
DEBUG=True(see line 38)But then if we look at
def executewe can see (as you point out) that it’s blocking. We’ll that sort of answers your question. You aren’t going to get anything back as it’s blocking it. So how do you fix this – write a non-blocking excute method;) There is some hints in examples/timeout.py. Apparently someone else has run up on this but hasn’t really fixed it.I know this didn’t probably help but I spent 15 minutes looking – I should at least tell you what I found.. You would think that
executewould give you someresult— Wait what is the value of result in line 707??If status != CS_SUCCEED (which I’m assuming in your case is True) can you simply see what “result” is equal to? I wonder if they just failed raise the result as an exception?