On Tue, 23 Mar 1999, Paul Everitt wrote:
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.
Ahh, no need. Just put one Database Connection object in the top folder and all the subfolders will "acquire" it. That is, any SQL Method defined lower down can use it.
There are connections to different databases. So you said "one connection to one database"?
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?
It should re-establish the connection. If it doesn't then there's a bug. This works fine with all the Database Adapters I've used.
I'll retest, but currently, when I ask ZPygresDA to close connection, Zope reports "the site has technical difficulties" when I'm trying to access the application.
define a timeout, after which Zope close a connection if there is no Hmm, this is quite a hard thing to do, unfortunately.
Bad news. :(
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?
Mind if I add a blurb to the Zope News about it?
It's Ok. I am not sure about correctness. And it is definetely far from complete. I'll continue working on it.
--Paul
Oleg. ---- Oleg Broytmann National Research Surgery Centre http://sun.med.ru/~phd/ Programmers don't die, they just GOSUB without RETURN.