On Thu, 2006-04-05 at 08:23 -0230, Rocky Burt wrote:
> On Thu, 2006-04-05 at 10:43 +0200, Stefan H. Holek wrote:
> > Note that Zope2.app() opens a new ZODB connection which you need to  
> > close at some point. I suggest something along the lines of:
> > 
> >     app = Zope2.app()
> >          try:
> >             products = app.Control_Panel.Products
> >             ...
> >     finally:
> >             app._p_jar.close()
> > 
> > I am also wondering if this code would break if a product was removed  
> > from the file system, but still had its persistent part hanging  
> > around in Control_Panel.Products.
> 
> Hmm... good points, I'll look into this.

Actually, this brings up something I've been wondering about.  Everytime
I call Zope2.app() inside a test case it gives me a new obj with a reset
Control_Panel.  Am I doing something wrong here?  Perhaps there's a
better way to go about this?

- Rocky



-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server -- http://www.serverzen.net


_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to