[Zope-DB] question on zope DAs

Tom Jenkins tjenkins@devis.com
16 Oct 2001 16:56:14 -0400


Hello all,
We're trying to track down a problem that may be related to a database
adapter (DA).  We've looked at a couple of different DA's and noticed
discrepancies between them in the _begin method.

zpsycopg:
def _begin(self):
   self.db.rollback()

zpopy:
def _begin(self):
   pass

zpygresql:
def _begin(self):
  self.db.query('begin transaction')

DCOracle2:
not defined... TM.py has def _begin(self): pass

gvibda:
def _begin(self):
  try:
    self.cursor.execute('select count(*) from rdb$relations')
  except StandardError:
    self.connection = gvib.gvib.connect(self.db, self.user, ....)
    self.cursor = self.connection.cursor()

looks like zpsycopg rollbacks any uncommited transactions before
starting another, both zpopy & DCOracle2 ignore calls to _begin,
zpygresql issues a begin transaction call (?) but gvibda is
interesting.  It does a count query against a known database to see if
the connection is still up; if not it will create another connection and
cursor.

Which is more correct?  The interbase (gvibda) is interesting as it
looks like it will reconnect if it can't get a response.

-- 

Tom Jenkins
Development InfoStructure
http://www.devis.com