Hi Agustin, moving this to its own thread. On 2/25/12, Agustin Lopez <agustin.lo...@uv.es> wrote: > Hi all! > > Talking about nspostgres, has anybody implemented any way to auto reconnect > to the database in a Postgresql start / stop? > > Thanks, > Agustin
Since the normal procedure when restarting pg is to stop pg client programs, stop pg, start pg and start clients, I didn't see a use to try implementing this. What I did see was extra code ran every time nspostgres was used to query (or use ddl/dml) to make sure a connection was stable, and that could be a heavy cost, especially if pg is not running on the same machine as its clients (incl aolserver). Having said that, I'd like to explore what would be required to make that happen. It seems to me one of the better approaches, is don't make the clients have to do anything different, that is, they don't have to know the db closed and reopened. In this approach, there seems to be three states for a connection: (1) it's good, and ready to accept queries; (2) the database has restarted, it's up and ready, but the underlying connection has to be replaced (leading to state 1); or (3) the database is in the process of restarting, so a query is not possible at this time. If this is the approach we want, then the first order of business is to determine which of the three states we're in. Can we start by just assuming we're in state 1 and sending a query? If we do this and we're in state 2, does the process segfault (due to the thing that used to be in ram not being there)? Let's start here. -Jim ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ aolserver-talk mailing list aolserver-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/aolserver-talk