5 Replies Latest reply on Apr 4, 2003 10:25 PM by adrian.brock

    JBossMQ: ORA-01000: maximum open cursors exceeded

    mtf1965

      Hi,

      We encounterd a problem while testing a simple MDB example. It's just a client writing messages to a queue and a message driven bean receiving these messages.
      If we now start sending messages in the beginning all works fine, but after some hundred messages jboss reports the following java exception:

      org.jboss.mq.SpyJMSException: Could not store message: 1028; - nested throwable: (java.sql.SQLException: ORA-01000: maximum open cursors exceeded)

      We use Jboss3.0.2, Oracle8i Enterprise Edition Release 8.1.7.0.0 together with jdbc2 PersistenceManager for the queue. Oracle is configured to 350 cursors.

      Does anybody know whether this is a configuration problem or a bug? And how to solve the problem?

      thanks in advance...

        • 1. Re: JBossMQ: ORA-01000: maximum open cursors exceeded

          I recently fixed a bug that will be available in
          3.0.7 and 3.2 where it wasn't closing a
          statement.

          It could also be that your application isn't closing
          connections since they share the same pool.

          Regards,
          Adrian

          • 2. Re: JBossMQ: ORA-01000: maximum open cursors exceeded
            dhe

            When is 3.0.7 available?

            • 3. Re: JBossMQ: ORA-01000: maximum open cursors exceeded

              Not sure.

              We are currently working on 3.2 final which
              is due out. There are a few remaining problems
              to address.
              Once that is out the door, 3.0.7 will be next.

              Regards,
              Adrian

              • 4. Re: JBossMQ: ORA-01000: maximum open cursors exceeded
                platinum

                Hello,
                Please teach me how to avoid this problem except for waiting fot 3.0.7 release.
                Thank you.

                • 5. Re: JBossMQ: ORA-01000: maximum open cursors exceeded

                  The fix is in
                  org.jboss.mq.pm.jdbc2.PersistenceManager

                  The try block with stmt.close() was missing

                  public org.jboss.mq.pm.Tx createPersistentTx() throws JMSException
                  {

                  org.jboss.mq.pm.Tx id = new org.jboss.mq.pm.Tx(nextTransactionId++);
                  TransactionManagerStrategy tms = new TransactionManagerStrategy();
                  tms.startTX();
                  Connection c = null;
                  PreparedStatement stmt = null;
                  boolean threadWasInterrupted = Thread.currentThread().interrupted();
                  try
                  {

                  c = datasource.getConnection();
                  stmt = c.prepareStatement(INSERT_TX);
                  stmt.setLong(1, id.longValue());
                  stmt.executeUpdate();

                  }
                  catch (SQLException e)
                  {
                  tms.setRollbackOnly();
                  throw new SpyJMSException("Could not crate tx: " + id, e);
                  }
                  finally
                  {
                  try
                  {
                  stmt.close();
                  }
                  catch (Throwable e)
                  {
                  }
                  try
                  {
                  c.close();
                  }
                  catch (Throwable ignore)
                  {
                  }
                  tms.endTX();

                  // Restore the interrupted state of the thread
                  if( threadWasInterrupted )
                  Thread.currentThread().interrupt();
                  }

                  return id;
                  }

                  Regards,
                  Adrian