tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: testOnBorrow = true
Date Sun, 15 Apr 2018 16:00:11 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Kota,

On 4/14/18 8:09 PM, Kota, Sriraghavi Latha  wrote:
> Hello, We are on Tomcat 8.5.23. We are trying to add fix to recover
> application after database restart.
> 
> Here are our versions:
> 
> Tomcat 8.5.23 DB2 version: 11.1 JDBCDriver: DB2JCC 4.22.9
> 
> Does testonBorrow = true issue a select statement to the database
> to validate the connection or is that a OPING which is a
> lightweight RPC?

This depends upon a couple of things. Tomcat 8.5 uses DBCP2 as the
default connection pool, but you can also use Tomcat's jdbc-pool
connection-pool as well.

If you are using either of these two pools, then setting
testOnBorrow="true" without setting a "validationQuery" will use the
JDBC driver's isValid() method to determine whether or not the
connection is okay. It's up to the driver to decide how to do that.

If you are using another connection-pool, it will depend upon whatever
that pool decides to do.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlrTdwsACgkQHPApP6U8
pFjLgg/+IZKQkUtChO1a3mOswRhpboa9Ds+AxkhGcqijcq3/3+l1dMBLdkUk8ki5
8WuWsfU7TZt7VU1m6tGibPsuuzAi5If7ZvB0YAMu3huTeavT4OtCyRwqsK1zuLPl
T0lhD1R+RG0ExtgfgbWWYfbTQztxNz7L6UVGD4oosga5j/8bliFK2ZsMaPfn5GgG
q2tJc6gi+4obAcQu4JxDGls1gUeWUea55SeAlMNc05CKUM/YC5mcJoRkDsBCYy8b
8boUyePxQUxVO49aE2DB90wlypIbh+vcbB007s/g2abzXJdBEmcvARaxPe6ClTJa
r35NhMR+meADbOgGlOda2HKzXvF+AZwIs/il87xwV1kvyTn55nJGLFv1gCFJpsn6
i/LvY//kL+8uWq0fFe0vkoHcLPaScQjAwrH2mpTikEp2kmPfZRR+l30B2aKIdKl6
b8oRrwQKnEo5tHwp3qAv/LBOV/XkEYcqzMLcNujm4ZN1FG4wz8bKiWiki2caGxql
mljHYWs1/iSJAmAOYllWww7cpTtN422cSZfEJ7RmIQduArJla90O6MSxQYzyHMp6
O76mmVpCVZBDC2hoDLVmOf7A18DXThR6LoImgIGVc3+IzM9+9nSw07vdyQYInDLK
Wpme9J6KWNmpo4u3+lMtP0/h00v7xvHQ1FLxz/Ik+TTRRRTYguU=
=PDUZ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message