[Zope] Database connections

Paul Everitt Paul@digicool.com
Tue, 23 Mar 1999 11:02:17 -0500


Oleg wrote:
>    There are connections to different databases. So you said "one
> connection to one database"?

If you can use one connection string in Postgres to access multiple
databases, then you just need one Database Connection.  Otherwise,
you'll need one connection per database.  Note that I don't mean per
table -- I don't know much about Postgres and don't know if it organizes
tables into separate databases that are selected with a "use database"
command.
 
> > >    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.

Right, which is the correct behavior, as you had disconnected from the
database.  I thought your question was about restarting _Zope_, so I had
a misunderstanding.

I don't know anything about the Postgres client library and whether it
can reconnect to a server when the server is shutdown.  This definately
isn't a Zope issue though -- the client should handle it.
 
--Paul