List:MaxDB« Previous MessageNext Message »
From:Christian Ullrich Date:June 20 2007 10:12pm
Subject:Unexpected exceptions in the python interface
View as plain text  
I'm trying to access a MaxDB 7.6 instance via python (2.5, see my other
post). Since I expect there to be connection timeouts in my application,
I need to make sure that a disconnected connection reconnects when
needed.

According to the documentation, and the python DB-API 2.0 spec, issuing
a query over a connection that has become disconnected should raise an
OperationalError exception (or a CommunicationError when using sapdb.sql
instead of maxdb.dbapi).

In my experience, which I gained by setting the connection timeout to 31
seconds (the lowest value permitted), connecting to the database,
waiting until the session disappeared from the DBM and then sending a
query, that doesn't happen. Instead I get a ProgrammingError via DB-API
and an SQLError from sapdb.sql.

What am I doing wrong? If I get what amounts to a syntax error, how can
I know what actually happened?

-- 
  Christian Ullrich  .  E-Mails sollten Text sein, Text und nur Text. 
                     .  Wenn Gott gewollt hätte, dass E-Mails in HTML
    Registrierter    .  geschrieben würden, endeten Gebete traditionell
 Linux-User #125183  .  mit <amen/>.
Thread
Unexpected exceptions in the python interfaceChristian Ullrich20 Jun