Thanks to all who helped, I finally solved the problem I was having with 
maximum open cursors in Oracle wiht JBoss/JAWS 2.0-Final.  Aaron Mulder 
suggested removing PreparedStatement caching, and that's what I did.

To verify that cursors are being closed properly use this SQL that 
somebody on the mailing list suggested:

 select SQL_TEXT,count(*),USER_NAME from
   V$OPEN_CURSOR group by SQL_TEXT,USER_NAME
    order by count(*);


For future reference, you need to change these classes(If I've done 
anything wrong, please tell me):
org.jboss.minerva.jdbc.ConnectionInPool
org.jboss.minerva.jdbc.PreparedStatementInPool
org.jboss.minerva.xa.XAClientConnection


For ConnectionInPool and XAClientConnection comment out cacheing code in 
statementClosed:
   public void statementClosed(Statement st) {
       statements.remove(st);
   /* Don't cache because we can easily reach max open cursors
       if ((con != null) && (st instanceof PreparedStatementInPool)) {
           // Now return the "real" statement to the pool
           PreparedStatementInPool ps = (PreparedStatementInPool) st;
           PreparedStatement ups = ps.getUnderlyingPreparedStatement();
           int rsType = ResultSet.TYPE_FORWARD_ONLY;
           int rsConcur = ResultSet.CONCUR_READ_ONLY;

           // We may have JDBC 1.0 driver
           try {
               rsType = ups.getResultSetType();
               rsConcur = ups.getResultSetConcurrency();
           } catch (Throwable th) {
           }
           PreparedStatementInPool.preparedStatementCache.put(
                   new PSCacheKey(con, ps.getSql(), rsType, rsConcur), ups);
       }
   */
   }


In PreparedStatementInPool you must close the actuall PreparedStatement:

   public void close() throws SQLException {
   if (impl != null) {
       impl.close();
   }
       con.statementClosed(this);
       super.clearFields();
       con = null;
       impl = null;
       sql = null;
   }




--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]

Reply via email to