1

My application is using tomcat jdbc connection pool through hibernate. Database is Oracle RAC. For connection pool, I have MaxActive=75 MinIdle=5,MaxIdle=35, InitialSize=5,testWhileIdle=false,testOnReturn=false

While I start my application and look into database v$session table, I can see five connections for that user but after one hour, v$session table has only 3 connections.

Since MinIdle value is 5, why is there only 3 connections in database?

sapa
  • 23
  • 3
  • well there are some other parameters that will define the Min Idle pool Size , but still what your saying looks like an issue. Could you please check one more thing , after the hour , is the connection pool from JAVA side still keeping 5 connections , but from DB side are only 3 open ? Or from both sides you can see 3 connections ? for the first , then you have to configure your database properly , otherwise , i suspect that your JDBC pool config is not being picked up at all , and you are looking the default config. – AntJavaDev Aug 08 '16 at 11:07
  • From JDBC connection pool connection is 5 where all five are idle but at the database side there are only 3 connections. – sapa Aug 16 '16 at 10:12
  • well are you sure you havent configured anything at Oracle's side ? because by default it does not close the inactive Connections. Also can you post how you are displaying the active sessions for that user? Also i dont know whether this [issue](http://dba.stackexchange.com/questions/59200/oracle-idle-connections-lost) applies to you – AntJavaDev Aug 16 '16 at 11:13
  • I am checking sessions in oracle DB with query select sid,username,program,status from v$session where username='' and program='JDBC Thin Clien t'. From tomcat jdbc connection pool side, we have mbeans which we can monitor from jconsole. – sapa Aug 17 '16 at 10:43
  • in case there is issue because of firewall and connections are getting closed because of that. If I make testWhileIdle parameter true, I think it should sync tomcat connection pool and oracle db connection pool size. Will making this parameter true will impact performance badly? – sapa Aug 17 '16 at 10:55
  • well it really depends on your application runtime traffic(f.e. if you have a pool size of 50 connections but you have 100 active users , then it would create some overhead, otherwise it wont cause any large impact) , but you can try adding it and also set the `timeBetweenEvictionRunsMillis` as described [here](https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html). As a second tryout , could you bypass the firewall/proxy in order to check if you have the same behaviour ? – AntJavaDev Aug 17 '16 at 11:09

0 Answers0