[Zope] Database connections

Oleg Broytmann phd@sun.med.ru
Tue, 23 Mar 1999 18:31:22 +0300 (MSK)


Hello!

   I've finished large project using pure CGI concept (I used Neale's
html.py). Now I (and my boss) are thinking of switching to Zope, or at
least ZTemplates.

   While playing with Zope and SQL (I am using Postgres, hence ZPygres
Database Adapter), I found that Zope, when loaded into memory by Zope.cgi
(I am using Apache, and need to use in the future) opens a database
connection for every Folder where I created Connection object.
   It is bad, as I have many databases, so Zope eats up memory. Another
problem - what would do Zope if I restart Postgres (so all current
connections break)? Would Zope reestablish connections or just report
error?
   How could I limit number of connections Zope opens? How could I
define a timeout, after which Zope close a connection if there is no
activity between Zope and Postgres? and reestablish connection when
application ask for SQL data?

   With ZTemplates and CGI all these questions has one easy (but not so
nice) answer - there is no constant connection, a connection established on
every CGI invocation.

PS. BTW, I wrote short introduction to Zope in Russian:
http://sun.med.ru/~phd/Russian/Zope/
   Any Russian here to verify my understanding of Zope?

Oleg.
---- 
    Oleg Broytmann  National Research Surgery Centre  http://sun.med.ru/~phd/
           Programmers don't die, they just GOSUB without RETURN.