[ZODB-Dev] Closing ZODB connection

Jeremy Hylton jeremy at zope.com
Wed Oct 29 11:17:48 EST 2003


On Wed, 2003-10-29 at 11:05, Antonio Beamud Montero wrote:
> Then in a case as before I need to do something like:
>     def get_reg_list(self):
>         con = self.db.open()
>         root = con.root()
>         list = root['status'].get_register_list()
>         con.close()
>         return list
> 
> No?

No.  You need to keep the connection open as long as you are using
objects that were loaded from that connection.  The list you are
returning contains objects loaded from con, so you can't close it.

Jeremy





More information about the ZODB-Dev mailing list