[ZODB-Dev] Closing ZODB connection

Jeremy Hylton jeremy at zope.com
Wed Oct 29 10:57:32 EST 2003


On Wed, 2003-10-29 at 10:53, Antonio Beamud Montero wrote:
> Is correct to close the connection this way?
>    ....
>    def get_reg_list(self):
>        con = self.db.open()
>        root = con.root()
>        con.close()
>        return root['status'].get_register_list()
> It works but can be dangerous?

It works sometimes, but only by accident.  You should not use a
connection after it is closed.

Jeremy





More information about the ZODB-Dev mailing list