-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Luc,
On 2/5/15 5:25 AM, Luc DALLEMANE wrote: > The keep alive on postgres was already setup, but was not working. > However, I finally found a workaround. > > I'm using the tomcat connexion pool, but For the authentication, > Tomcat is creating its own connexion and does not use the pool (and > seems to use the same connexion all along the session). > > So I think that's was why it was dropped by the firewall after a > while, and when we restarted tomcat, the connexion was recreated > and it worked again. > > To resolve this problem, we override Tomcat's authenticate method. > We made our own open function which uses the postgres driver and is > called in the authenticate. We do not use the getPassword and > getRoles function, because they used the Tomcat's "global" > connexion. > > With this, we are now able to connect to the site even after a long > period of inactivity. > > Thank you for your help, and maybe this could help someone else. None of that should be necessary /at all/. Did you switch-over to using the DataSourceRealm or not? JDBCRealm is pretty stupid. - -chris > ________________________________________ De : Felix Schumacher > <felix.schumac...@internetallee.de> Envoyé : mercredi 4 février > 2015 20:11 À : Tomcat Users List Objet : Re: JDBC authentication > problem > > Am 04.02.2015 um 14:21 schrieb Luc DALLEMANE: >> Hi, >> >> I'm back again with the problem :) >> >> Firstly, I add the validationQuery and it works and I can see it >> in postgres logs. >> >> But still not able to login after a while of inactivity.... >> >> Now, after 15 min of waiting, I'm getting a socket connexion >> timeout, but seems logic after such a long period of trying to >> connect. >> >> Thank you again for your ideas and haven't found a solution. > You might try to enable keepalive on your postgresql connection. > Connection porperties can be specified with the attribute > "connectionProperties" (at least according to > http://commons.apache.org/proper/commons-dbcp/configuration.html) > or in the jdbc url jdbc://...?tcpKeepAlive=true. You can even > specify the timeout for connnecting to your database. > > Regards Felix >> >> Regards, Luc. ________________________________________ De : >> Konstantin Kolinko <knst.koli...@gmail.com> Envoyé : mardi 3 >> février 2015 12:33 À : Tomcat Users List Objet : Re: JDBC >> authentication problem >> >> 2015-02-03 14:29 GMT+03:00 Luc DALLEMANE >> <ldallem...@alaloop.com>: >>> Hi, >>> >>> Thanks for the reply, I tried to add the options you told me >>> about (testWhileIdle, timeBetweenEvictionRunsMillis, and >>> maxConnLifetimeMillis), but I'm still unable to log after un >>> hour ... >> Do you have validationQuery configured? testOnBorrow, >> testWhileIdle do not work without it. >> >> >> Best regards, Konstantin Kolinko >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org iQIcBAEBCAAGBQJU03ulAAoJEBzwKT+lPKRYUPoQAKUx68eqWORIYbvUJr9i2G01 cd7xbemgBy0tWP2DmCG6D1MAEqfzphXXTCuOqvf1sg3aU+XbQtAexezJA826XXVb 5KrgQu3wYWG0Bc3D2tCNrzLzz8yqUE33+R+H13CGXPBX5vO48DvfjUZuMQ65/SQ+ G05t1LuljBTVulqwzK3l4lt48CS02xTlEu7KtMQ0WagmoeTnjBPZRjxuMNdtXeW6 DIW4MT++yOgptlOyyHbY1rjtlobP9vSpKK97cuwbG1W9DN+9FQ2HqDe+7V9QnNVg 9vr3eyj6wkOYAdzwatT8yusugxFJhl3reMavGdeYZzyv1leC6oLlBEZ4SEG5mftu yT7L9pwNWPChJVhpq8VXDWsz63M8WGCDYyvjjRKCkca0eUSRv2dnWTsjsDfRTLT7 JORaDs1KF5x57Wb0yy7sLcsPty9U+FAxhFykYQdGUKjB8O9ZEZ+NFv0XrIqn0M+R 6+8r5ndr1uG+vqETeTnK4Eq+l2aZ0OaYbBhf0mpDvhCcqGlbD19AglUUsWN5Gevw FLPhi0FSokLnV6uthypeKIixEtB66BrHsnXb+yl/q42GfExeSPEwSzLS48spPxDf AppY8vCGdhtkEwhJqsbpdgeEwOakMhs1e8TuJ2tXIiDMoCLrcEmH0Lur0twWt0NW CGqDrWy22blnCxqcneTj =iDbk -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org