File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes oracle connection pool setting and database cursors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "oracle connection pool setting and database cursors" Watch "oracle connection pool setting and database cursors" New topic
Author

oracle connection pool setting and database cursors

Amit Da
Greenhorn

Joined: Mar 07, 2003
Posts: 16
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

Joined: Feb 27, 2002
Posts: 8919

I think it is because the physical connection is not closed.


Groovy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: oracle connection pool setting and database cursors