[Zope-DB] DCOracle DB has no close() method?!

Matthew T. Kromer matt at zope.com
Thu Sep 25 15:58:44 EDT 2003

Chris Withers wrote:

> Hi,
> With the changes I submitted to CVS versions of Connection.py, I'm now 
> seeing these on closing a ZOracleDA adapter instance:
> ------
> 2003-09-25T13:07:56 ERROR(200) Shared.DC.ZRDB.Connection Error closing 
> relational database connection.
> Traceback (innermost last):
>   File 
> /usr/local/Zope-2.6.1-src/lib/python/Shared/DC/ZRDB/Connection.py, 
> line 147, in manage_close_connection
>     (Object: Oracle_database_connection2)
> AttributeError: DB instance has no attribute 'close'
> How would a DB instance not have a close method?
> Chris

It is probably going after db.py in ZOracleDA, the DB object there has 
neither open nor close methods.  Instead, it has __init__ and __del__ 
methods.  I don't see any harm in your adding a close method though, e.g.

    def close(self):
       if self.cursor:
            self.cursor = None
       if self.db:
            self.db = None

Matt Kromer
Zope Corporation  http://www.zope.com/ 

More information about the Zope-DB mailing list