[Zope-dev] The Application object

Shane Hathaway shane@digicool.com
Tue, 18 Jul 2000 08:19:29 -0400


Yves-Eric Martin wrote:
> 
> Shane Hathaway <shane@digicool.com> wrote:
> > You *must* remember to close the connection:
> >
> > app._p_jar.close()
> 
>     This is not mentionned in the above document, so I was doing without
> so far, and did not run into any problem. Now that I see it, I believe
> this is the Right Thing to Do and will include it in the release. But
> since you put an emphasis on its being required, can you tell us what
> evil things may happen if you don't close the connection? (Consuming
> ressources?)

That's correct.  Only a certain number of connections are allowed at a
time.  Currently, as the "app" object falls out of scope it should
close the connection automatically, but that may not always be the case
IMHO.

BTW if you're using this technique, be sure you're not opening two
connections in one thread.  It can prove hazardous.

Shane