Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

oracle connection pool setting and database cursors

 
Amit Da
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Oracle's connection pool for managing connections. After using a ResultSet or executing a DML statement, I close the ResultSet, Statement and also finally the connection object(logical connection obtained from pool) to free the resources.
But it was noticed that in database there were several INACTIVE CURSORs and at some point they even reached the MAX number set in init file. Does anyone know how to resolve this ?
I tried settings -
setCacheInactivityTimeout(1),
setCacheTimeToLiveTimeout(1);
setThreadWakeUpInterval(60)
on the connection cache object and that gets rid of the CURSORs faster but I am not sure what would be the reasonable values. The first two methods take a long. Is that in milis/s/minutes/hours ??? what's the unit ? Is anyone using these methods and knows what would be good settings for an enterprise app pool that has a lot of database interaction and several users(50+) hitting database at same time ?
Code snippet of pool usage:
OracleConnectionPoolDataSource ocpds = new OracleConnectionPoolDataSource(); ocpds.setDriverType("thin");
ocpds.setPortNumber(1521);
ocpds.setDatabaseName(lsDatabaseName);
ocpds.setServerName(lsServerName);
ocpds.setUser(lsUser);
ocpds.setPassword(lsPassword);
OracleConnectionCacheImpl ocach = new OracleConnectionCacheImpl(ocpds);
/*
ocache.setCacheInactivityTimeout(1);
ocache.setCacheTimeToLiveTimeout(1);
ocache.setThreadWakeUpInterval(60);
*/
-Amit
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is because the physical connection is not closed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic