Be sure to close the objects in the proper order and that you surround each
close() by a try/catch. for example if you do the following:
try{
rs.close();
stmt.close();
con.close();
} catch(Exception e){
}
You may fail on closing the resultSet, and not continue to close the
statement or connection.
You should use a method something like the following to ensure everything
gets closed:
public void closeDBObjects(String objectName, ResultSet rs, Statement
s, Connection con) {
try {
try{
if (rs != null) {
rs.close();
rs = null;
} //if
} catch (Exception exc) {
log(objectName + ", Exception closing RS: " + exc.toString());
} //catch
try{
if (s != null) {
s.close();
s = null;
} //if
} catch (Exception exc) {
log(objectName + ", Exception closing S: " + exc.toString());
} //catch
try{
if (con != null) {
con.close();
con = null;
} //if
} catch (Exception exc) {
log(objectName + ", Exception closing connections: " +
exc.toString());
} //catch
} catch (Exception exc) {
log(objectName + ", Exception closing DB Objects: " +
exc.toString());
} //catch
} // closeDBObjects
-----Original Message-----
From: Jeff Fisher [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 10:27 AM
To: JDJList
Subject: [jdjlist] RE: Maximum open cursor error
I would say it would have to be in WebLogic, not Oracle. We use the thin
driver in our own home grown app server and the only time we've gotten this
problem is when we forgot to explicitly close a statement. Our server has
been running 24x7 for about 6 months now and we have not had an open cursor
problem.
-----Original Message-----
From: Sharma,Vimal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 10:20 AM
To: JDJList
Subject: [jdjlist] Maximum open cursor error
Guys,
We have an application that runs Weblogic Server 6.1sp1 with Oracle Thin
Driver on Oracle8.1.7. Servlet calls a stored procedure which returns a
cursor, than fetches the rows using the cursor and then cleanly closes
everything ( statements, results sets, connection ). Once in 3 days
application cashes with Exception:ORA-01000: maximum open cursors exceeded.
Mind it I have checked application many times for closing statement object,
resultset object and connection object. Everything is closed. Can it be any
other reason, like bug in oracle driver or in weblogic.
If anybody has any clue on this, it will be greatly appreciated.
Thanks,
Vimal
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm