How can I capture this warning message when the request is blocked?

When I make a request with isql, I get the following message and request blocks.

The transaction log in the foo database is almost full. Your transaction is suspended until space is available in the log.

When I do the same with Python:

cursor.execute(sql)

Request blocks, but I would like to see this message.

I tried:

Sybase.set_debug(sys.stderr)
connection.debug = 1

I use:

  • python-sybase-0.40pre1
  • Adaptive Server Enterprise / 15.5 / EBF 18164

EDIT: Question: "How can I write this warning message to a python program?"

+5
source share
3 answers

Good question, and I'm not sure I can fully answer it. Here are some ideas.

Sybase.py . , . "bump" logging out, :

import logging
logging.basicConfig(level = logging.INFO,
                    format = "%(asctime)s %(levelname)s [%(filename)s] (%(name)s) %(message)s",
                    datefmt = "%H:%M:%S", stream = sys.stdout)
log = logging.getLogger('sybase')
log.setLevel(logging.DEBUG)

, - ( ), Sybase.py, DEBUG=True (. 38)

def execute, ( ), . . , . , - excute;) /timeout.py . , - , .

, , , , 15 - , .. , execute result - , 707

                while 1:
                    status, result = self._cmd.ct_results()
                    if status != CS_SUCCEED:
                        break

!= CS_SUCCEED ( True), , "" ? , ?

+1

, , blocikng MDA sysbase mSysStatement.. sql, Io, , ..

-1

, (, ). , .

except, .

See the Sybase Python documentation .

-1
source

All Articles