Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Connection Pool Keeping more than necessary inactive connections

user12296100Jun 19 2015 — edited Jun 26 2015
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production0
PL/SQL Release 12.1.0.2.0 - Production0
CORE12.1.0.2.0Production0
TNS for Linux: Version 12.1.0.2.0 - Production0
NLSRTL Version 12.1.0.2.0 - Production0

Using JavaSE-1.7

Using ucp.jar,ons.jar and OJDBC7.jar

I set up the datasource as follows

pds = PoolDataSourceFactory.getPoolDataSource();

  pds.setConnectionFactoryClassName(factoryClassName);

  pds.setMaxPoolSize(maxPoolSize);                                                       maxPoolSize  10

  pds.setMinPoolSize(minPoolLimit);                                                        minPoolLimit 1

  pds.setMaxIdleTime(idleMaxTime);                                                        idleMaxTime 50

  pds.setMaxConnectionReuseTime(connectionReUseTime);                    connectionReUseTime 5

  pds.setConnectionWaitTimeout(waitTimeOut);                                       waitTimeOut 100

  pds.setAbandonedConnectionTimeout(abandonedConnectionTimeout);    abandonedConnectionTimeout 10

  pds.setInactiveConnectionTimeout(inactivityTimeout); // time in seconds  inactivityTimeout300

  pds.setTimeToLiveConnectionTimeout(timeToLiveConnection);               timeToLiveConnection 30

In the class that actually uses it I create a method variable for the connection object. Closing the connection as well as

pds.getConnection().close();

e

I am thinking that at the most I should have only one inactive connection showing up when I monitor the session. How do I configure the pool as to only show on inactive connection? I am running the test queries once every five minutes. But I am opening three connections each time.

Thank you

This post has been answered by unknown-7404 on Jun 25 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2015
Added on Jun 19 2015
11 comments
3,683 views