On 1/21/22 9:28 AM, Alan F wrote:
Ok thanks Phil ok I checked other connections in the same host and see minIdle="2" and 
initialSize="7"

Ive run a diff on this server.xml between our active prod hosts which shows 
connections on Toad up for at least a day as to this idle server reconnecting 
after minutes!  And diff is identical apart from Cluster ips.
Most likely culprit is network or other issue causing validations to fail.  With testWhileIdle on, idle connections in the pool will be tested when visited and closed if validation fails.

Phil




-----Original Message-----
From: Phil Steitz <phil.ste...@gmail.com>
Sent: 21 January 2022 16:10
To: users@tomcat.apache.org
Subject: Re: Tomcat jdbc connections



On 1/21/22 8:19 AM, Alan F wrote:
Thanks John,

Here is an example of a connection below I see
timeBetweenEvictionRunsMillis but not maxConnLifetimeMillis if the
server has no traffic does this mean

<Resource type="javax.sql.DataSource" auth="Container" name="XXXXXXXX" 
timeBetweenEvictionRunsMillis="60000" testWhileIdle="true" testOnReturn="false"
testOnBorrow="true" removeAbandonedOnBorrow="true" maxWaitmillis="30000" defaultQueryTimeout="30" 
validationQuery="select * from dual" maxTotal="10" maxIdle="5"
url="jdbc:oracle:thin:@XXXXXXX:XXXXX:XXXX" username="XXXXXXX"
password="XXXXXXXX"  driverClassName="oracle.jdbc.OracleDriver" />


So above does that mean every 60 secs Eviction runs, does this mean a server 
with no traffic evicts unused connections to DB?
One more note on this config.  Since you have not specified minIIdle or 
initialSize, the pool will not create connections until they are requested by 
clients.

Phil

-----Original Message-----
From: john.e.gr...@wellsfargo.com.INVALID
<john.e.gr...@wellsfargo.com.INVALID>
Sent: 21 January 2022 14:50
To: users@tomcat.apache.org
Subject: RE: Tomcat jdbc connections

Alan,


-----Original Message-----
From: Alan F <shiva...@hotmail.com>
Sent: Friday, January 21, 2022 6:53 AM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: RE: Tomcat jdbc connections

Hi Christopher

Thanks for your time here.

You mean like, a connection is made, no queries are executed, and
then the connection is terminated?
- ANSWER -  DBAs are saying connections last a minute or so and are
replaced by a new set of connections 1 session each pool.


Presumably, you have an application running on Tomcat with a JDBC
connection configured. Are you using Tomcat's built-in pooling, or is
your application managing its own pooling/connections?
- ANSWER we are using dbcp2


Do you have any background tasks (in the JVM) that will run even when
there is no user activity? Cache-management? Lazy-writes?
- ANSWER I don't think so.


Are you using Tomcat's clustering? Are you using a database-backed
session management or any kind? -
- ANSWER YES clustered B node down, A node up this Tomcat node is not
live or receiving any traffic currently in test.


Are the connections definitely being made from the application itself
and/or Tomcat? Or do you just see those connections coming from the
IP where the application is running? - ANSWER im assuming according
to server.xml they are utlising these declared connections via Tomcat.


Do you have any background tasks (outside the JVM) that will run even
when there are no user actions? For example, some monitoring system
that pings the server to say "can you reach the database?" - ANSWER
NO


O

Could your pool be closing the connections after a set time?  Look at 
timeBetweenEvictionRunsMillis and maxConnLifetimeMillis here:

https://commons.apache.org/proper/commons-dbcp/configuration.html
B KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB  [  
X  ܚX KK[XZ[
   \ \  ][  X  ܚX P X ]
   \X K ܙ B  ܈Y][ۘ[  [X[  K[XZ[
   \ \  Z[ X ]
   \X K ܙ B

---------------------------------------------------------------------
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

Reply via email to