Re: How does an application recognize the death of the postmaster - Mailing list pgsql-general

From Guy Rouillier
Subject Re: How does an application recognize the death of the postmaster
Date
Msg-id D4D1632DC736E74AB95FE78CD6090079012623@mtxexch01.add0.masergy.com
Whole thread Raw
In response to How does an application recognize the death of the postmaster  (Geoffrey <esoteric@3times25.net>)
List pgsql-general
Geoffrey wrote:
> How do folks handle the death of the postmaster in their applications?
> Assuming the postmaster dies after an application has connected to the
> database, but before it makes a request.  What should I look for?
> Currently our application that's in development does not handle the
> situation well.  What we want to do is gracefully (as possible)
> shutdown the application.

Really depends on your run-time environment.  Running Java under the
JBoss app server or the Tomcat servlet container, you can configure data
sources so that they test a connection before parceling them out to
applications.  If a pooled connection has gone dead, the container will
discard it and get another one for you.  That will allow you application
to be blissfully unaware of momentary glitches.  However, that obviously
won't help if your database is down hard for an extended period.  Both
containers can be configured to give up trying and return an error to
your app.

--
Guy Rouillier



pgsql-general by date:

Previous
From: "Larry Rosenman"
Date:
Subject: Re: out of memory for query result
Next
From: Martijn van Oosterhout
Date:
Subject: Re: out of memory for query result