From: Gerson G. <ger...@gm...> - 2011-05-29 23:15:11
|
Thanks a lot for your advice Andrea, Adding "params.put(VALIDATECONN.key, Boolean.TRUE);" seems to have done the trick. Cheers, Gerson On 05/27/2011 04:52 PM, Andrea Aime wrote: > On Fri, May 27, 2011 at 4:48 AM, Gerson Galang<ger...@gm...> wrote: >> Hi again, >> >> I've written a portlet that needs to perform a number of PostGIS queries >> per http request. There are times when the query just wouldn't work. >> Whenever the query fails, I get this on the log file... > My guess is that your postgis is setup to drop the connections to the client > after a certain timeout. > The best thing would be to enable the connection validation in the params, > the connection pool with then first send a fast query (normally getting > the current date) to check if the connection is still valid before giving it > back to the code in the data store > > Cheers > Andrea > > |