[Zope-DB] automating db connections
Joel Burton
joel@joelburton.com
Wed, 6 Mar 2002 12:02:27 -0500 (EST)
On Tue, 5 Mar 2002, Dieter Maurer wrote:
> D.Rick Anderson writes:
> > I need to figure out how to close and re-open a database connection from
> > within Zope.
> This calls for a standard answer:
>
> You can do it from Zope Management Screen.
> Look at the source of the defining dtml page.
Yep. Always a good idea. Look at the source for the frame where the button
to "close connection" appears, and you can see that this is
manage_close_connection. To open, it's manage_open_connection.
ZSQL stuf can be a little tricky to find by source code since there's a
few levels of abstraction going on, but this methods are defined in
Shared/DC/ZRDB/Connection.py
You could use xron or just plain ordinary cron, having cron use
lynx/wget/curl/python-urllib/whatever to get the pages
/folder/db_item/manage_close_connection then manage_open_connection
--
Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant