[Zope] Re: Zope with ZsapdbDA

Daniel Dittmar daniel.dittmar@sap.com
Wed, 04 Sep 2002 23:06:35 +0200


In lib/python/Products/ZsapdbDA/DCsapdb/sapdbapi.py
replace method wrapCall with the following:
def wrapCall (call, *args):
     try:
         print call, args
         result = apply (call, args)
         print '==>', result
     except sapdb.SQLError, err:
         print str (err)
         raise ProgrammingError (err)
     except sapdb.CommunicationError, err:
         print str (err)
         raise OperationalError (err)
     return result

and restart Zope in a terminal/console window.
The following shows a few of the errors that might occur:


<built-in function connect> ('TEST', 'TEST', 'TST', 'dopeydad', 'timeout=0')
==> <SapDB_Session object at 019604C0>

<built-in function connect> ('TEST', 'TEST', 'TST', 'nohost', 'timeout=0')
sapdb.CommunicationError: [1] unknown host name

<built-in function connect> ('test', 'TEST', 'TST', 'dopeydad', 'timeout=0')
sapdb.SQLError: [-4008] (at 1) Unknown user name/password combination

<built-in function connect> ('TEST', 'TEST', 'TST2', 'dopeydad', 
'timeout=0')
sapdb.CommunicationError: [1] database not running

<built-in function connect> ('TEST', 'TEST', 'TST', 'calvin', 'timeout=0')
sapdb.CommunicationError: [1] could not connect to socket [10060]

<built-in function connect> ('TEST', 'TEST', 'TST', 'calvin', 'timeout=0')
sapdb.CommunicationError: [5] XSERVER might be inactive

This gives hopefully more information about what's wrong
with the connection string

Daniel

-- 
Daniel Dittmar
SAP DB, SAP Labs Berlin
daniel.dittmar@sap.com
http://www.sapdb.org