[Zope-dev] DB.close() needs to be called

Toby Dickenson tdickenson@geminidataloggers.com
Wed, 13 Nov 2002 09:03:44 +0000


On Tuesday 12 November 2002 7:16 pm, Barry A. Warsaw wrote:
> Looks like Toby's recent change to ApplicationManager.py causes
> DB.close() to never be called when you hit Shutdown in the Control
> Panel.

Yes.

>  This is a bad thing for the Berkeley storages because their
> .close() must get called or you'll end up with corrupt databases or
> worse <wink>.

How much of that paragraph is covered by the wink?

Even before my recent changes, there are plenty of other ways that Zope c=
an=20
open the storage, run a transaction, then hit an error before properly=20
starting up which means it fails to close the database correctly.

Would this be bad?

> So here's a patch to z2.py to fix this.  I won't check this in because
> it looks a little ugly to me and I'm not sure what the right fix is,

That is exactly what I was planning to commit.

Before making that change, I need to remove a couple other calls to db.cl=
ose()=20
to prevent it being called twice on the same db.=20

> but we definitely need to fix this before Zope 2.6.1 is released.

2.6.1? This change has only been on the trunk, not the 2.6 maintenance br=
anch.