After running the excalibur 4.1 pooling for some time with tomcat, Oracle started
giving the "ORA-01000: maximum open cursors exceeded" error. I had not changed
anything with Oracle or my web application, except for replacing my modified
excalibur 4.0 with new excalibur 4.1. After looking at the 4.1 source code, I found
that isClosed() method in AbstractJdbcConnection class did not close the result set
after executing the test statement. I had fixed this in the my modified version of
excalibur 4.0 JdbcConnection class. ( I had fixed this to track down another bug I
sent in a while back for class JdbcConnection in excalibur 4.0).
Excalibur 4.1 code:
public boolean isClosed()
throws SQLException
{
if ( m_connection.isClosed())
{
return true;
}
long age = System.currentTimeMillis() - m_lastUsed;
if ( age > 1000*60*60 ) // over an hour?
{
this.dispose();
return true;
}
if (m_testStatement != null && age > (5*1000)) // over 5 seconds ago
{
if (getLogger().isDebugEnabled())
{
getLogger().debug("Pinging database after " + age + "ms of
inactivity.");
}
try
{
m_testStatement.executeQuery();
}
catch (final SQLException se)
{
this.dispose();
return true;
}
}
return false;
}
My old modified JdbcConnection class from excalibur 4.0:
public final boolean isClosed()
throws SQLException
{
if ( m_connection.isClosed())
{
System.out.println("connection closed");
return true;
}
if ( this.m_num_uses <= 0 )
{
this.dispose();
System.out.println("num uses=0");
return true;
}
if (m_test_statement != null)
{
try
{
java.sql.ResultSet rs = m_test_statement.executeQuery();
rs.close();
}
catch (final SQLException se)
{
this.dispose();
System.out.println("sql test failed");
return true;
}
}
return false;
}
Annette Doyle
CALEB Technologies Corp.
[EMAIL PROTECTED]
512.617.2212
"The information contained in this message is confidential, and is intended only for
the use of the individual(s) named above. If the reader of this message is not the
intended recipient, you are hereby notified that any copying, disclosure or
distribution to others, or other use of this message in any form is strictly
prohibited. If you have received this message in error or are not the intended
recipient, please notify the sender and delete this message from your system."
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>