tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aniket Bhoi <aniket.b...@gmail.com>
Subject Re: Debugging Tomcat JDBC pool disconnects.
Date Tue, 07 Oct 2014 16:29:51 GMT
On Tue, Oct 7, 2014 at 8:41 PM, Todd Chapman <todd@chaka.net> wrote:

> Chris,
>
> Thank you for the detailed reply and sorry for my delayed response. We
> located the problem.
>
> We had setTestOnBorrow(true) but had not set the validation query. When the
> validation query is null the validation fails causing the connection to be
> re-opened.
>
> But I do see you have set poolProperties.setValidationQuery("SELECT 1 AS
data"); earlier
did that not help?.Is there something that you did differently

Regards
Aniket

> -Todd
>
> On Wed, Sep 24, 2014 at 9:36 AM, Christopher Schultz <
> chris@christopherschultz.net> wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > Todd,
> >
> > On 9/23/14 11:41 AM, Todd Chapman wrote:
> > > My application uses the Tomcat JDBC pool. While using netstat and
> > > tcpdump to diagnose connection problems I noticed that the client
> > > side occasionally closes a DB connection and opens a new one. That
> > > is unexpected based on my configuration.
> > >
> > > poolProperties.setInitialSize(10); poolProperties.setMinIdle(10);
> > > poolProperties.setMaxActive(100); poolProperties.setMaxIdle(100);
> > > poolProperties.setMaxWait(10000);
> >
> > Okay.
> >
> > > poolProperties.setTimeBetweenEvictionRunsMillis(30000);
> > > poolProperties.setMinEvictableIdleTimeMillis(30000);
> > > poolProperties.setTestWhileIdle(false);
> >
> > These 3 settings together don't make any sense: if you have disabled
> > idle-checking, then setting the schedule for idle-checking isn't
> > getting you anything.
> >
> > > poolProperties.setTestOnBorrow(true);
> > > poolProperties.setValidationQuery("SELECT 1 AS data");
> > > poolProperties.setValidationInterval(3);
> >
> > The validation interval is specified in milliseconds. Are you sure you
> > want a value so low?
> >
> > > poolProperties.setLogValidationErrors(true);
> > > poolProperties.setTestOnReturn(false); poolProperties. maxAge(0);
> >
> > Note that maxAge=0 is the default.
> >
> > > I would expect the pool size to never shrink based on this
> > > configuration. Well maybe if borrow test fails but no validation
> > > errors are being logged.
> > >
> > > How can I figure out where close() is being called on the physical
> > > DB connection? I tried writing a JdbcInterceptor but it's
> > > disconnected() method gets called on the PooledConnection, not the
> > > physical connection.
> > >
> > > Does Tomcat JDBC Pool implement javax.sql.ConnectionEventListener
> > > interface?
> >
> > Could this be the typical firewall-timeout where a network component
> > is dropping the connection in the middle, rather than one or the other
> > end of the connection dropping it?
> >
> > What about the database itself? Are there any connection timeouts over
> > there?
> >
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1
> > Comment: GPGTools - http://gpgtools.org
> >
> > iQIcBAEBCAAGBQJUIsjfAAoJEBzwKT+lPKRYBsYP/irwy6tz9Xrf4sM9zGCWc/AS
> > aLVyRua/ZhPy+wLyi/LRXjCXHdEekANIqdrKV9jXOPyyIvnB4kwKo3nubPtzNgA3
> > GeHeJktLjoz0OMrUI1TPUEU8wab2VNqXBmxF+5yOTExDKSUSfUee4xj/0EVgJ2Jw
> > +0YvldtF5RCcTtNNSR38+lUreTTkmaMDGCvhfFY6xXwtU3f7jLUhj9RbFMEwjgDs
> > W9VOHF9YKoleiPrzXVxHzPvvJB7k1aSoGreDOorauDnXHK6s5/9BhX7HxLUFZ1U7
> > /xdJR8Ul8XjaxNV7zfW1BErUCvjD2V27ASNPNHSnMGrJbElBW8tR23LeH+9Au0fI
> > w2/G7MsOp4GpU6t/8I0uyLoiEz85USyRJdVn/PuDTrV3X4aKXt3nnT3wUSQelkyq
> > zW+MASMflDPoxEjXPkvb9WO6a8ZaFFQQlHauqIkT1GUEpM0ii1cY7IJPJYSAyvg/
> > eMYUFTn17Ml1GCQeLvUWbcbbvisfUJC0SZ7l+5zlUD5FsU/B71gmqgIjVLN+qW6C
> > CfV7rBUgKBzgb8LfU2GE4e7PxFUj+161pv/Vyaf8UoYvhhzdXCtg76qndRgbwugK
> > gW2j5FApz934BiHNJKzVKfHI5nJPOpL44N2fQAG+KyT1Ojc8pr0E+8FB67g1eTYE
> > IvLlYB4adCxQcIy9wqxN
> > =9crk
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message