[ZODB-Dev] Exception when using dead connections

Toby Dickenson tdickenson at geminidataloggers.com
Thu May 8 17:06:09 EDT 2003


On Thursday 08 May 2003 3:54 pm, Christian Reis wrote:

> I'd suggest doing something like this:
>
>     if not self._storage:
>         raise ValueError, "Connection %s is not open!" % self

Yes, something like that.

>     if self._storage.is_closed():
>         raise ValueError, "Connection %s: storage was not open!" % self

Only the DB is supposed to call the close method on the storage, so Im not 
sure we need to defend against this case seperately. (Im not keen on this 
detail of the DB/storage interface, but I think we have already discussed 
this)


-- 
Toby Dickenson
http://www.geminidataloggers.com/people/tdickenson



More information about the ZODB-Dev mailing list