[ZODB-Dev] ZODB: Are all handles closed?

Christian Reis kiko@async.com.br
Fri, 7 Mar 2003 13:48:49 -0300


On Fri, Mar 07, 2003 at 11:31:22AM -0500, Jeremy Hylton wrote:
> > Both of your scripts have a bug that is causing the problem demonstrated in 
> > the second script. db.open returns a connection object, and you need to call 
> > close on the connection, rather than the db. db.close is an alias for 
> > storage.close.
> 
> This doesn't make much sense, does it?

No, it doesn't. db.close() should close the storage, and all
subsequent access through connections should fail, IMO. We could even
have a force=0 default parameter that aborted all transactions so we
don't get stuck waiting for shutdown (something like SHUTDOWN IMMEDIATE
in Oracle <wink>).

> If you close a database, the connection shouldn't continue to work.  The
> most obvious solution is that close() on the database calls close() on
> each connection.  In ZODB4, I just change Connection.close() so that it
> raises an exception if close() is called while a transaction is active. 
> So that would mean DB.close() could raise an exception.

+1 from me if you mean 'DB.close() will raise an exception if a
transaction is still active'.

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL