Database experiences in Python: Good or Bad?

Brad Clements bkc at Murkworks.com
Fri Aug 16 09:41:31 EDT 2002


Sorry Daniel, I didn't mean to imply a deficiency in sapdbapi.. I'm just
surprised that SAP DB itself represents timestamps as strings. Seems like a
big waste of space and slows down processing.. who knows.

Thanks for reminding me about registering conversion functions, I had
forgotten about them.

So far sapdbapi and ZSapDB is working okay, except for this traceback within
Zope:

  File "SQLDict.py", line 833, in insert
  File "SQLDict.py", line 387, in insert
  File "/usr/lib/python2.1/site-packages/sapdb/sapdbapi.py", line 211, in
execute
    result = wrapCall (self.__executeParsed, parsed, parameters)
  File "/usr/lib/python2.1/site-packages/sapdb/sapdbapi.py", line 60, in
wrapCall
    raise ProgrammingError (err)
ProgrammingError: sapdb.SQLError: [500] Lock request timeout

Now, Zope is unable to perform any transactions until I restart it. I
haven't had any time to debug this, so I'll follow up in the sapdb mailing
list with details when I have them.

_
"Daniel Dittmar" <daniel.dittmar at sap.com> wrote in message
news:ajdna2$8s5$1 at news1.wdf.sap-ag.de...
> Brad Clements wrote:
> > What's killing me today is that sapdbapi doesn't represent
> > times/dates as class objects, like I got with gvibDA.. I have a lot
> > of XSLT code that uses xml_pickle objects.. and a pickled timestamp
> > from gvib doesn't look anything like that from SAP.
> >
> > In fact, SAP timestamps are 20 character strings.. really ugly.
>
> It is easy to register conversion callbacks with sapdbapi.
>
> - write conversion functions from the SAP DB values to any
> object/representation you like
> - create a dictionary which maps the SAP DB type names 'Date', 'Time',
> 'Timestamp' to those functions
> - connection.setTypeTranslation (conversionMapping)
>
> see the end of sapdbapi.py for examples like converting to module time
> tuples
>
> Daniel
>
> --
> Daniel Dittmar
> SAP DB, SAP Labs Berlin
> http://www.sapdb.org
>
>
>




-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----



More information about the Python-list mailing list