Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-1702

DefaultDatabaseLocker causes Oracle to throw an exception "maximum open cursors exceeded" under heavy load

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0.0
    • 5.2.0
    • Message Store
    • None

    Description

      The API document for the java.sql.Statement class (http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#close()) says that statement objects are automatically closed during garbage collection, however, under heavy load (i.e. for an application that is processing multiple messages per second) you will quickly run out of cursors even before garbage collection gets to reclaiming prepared statements. Also any application that deals with huge volume is going to use a connection pool that also pools the statements, which means that the statement you created are referenced by the pool, thus they won't be garbage collected and closed. Just like the connection.close triggers the connection to be marked as available in the pool, statement.close will trigger the statement to be available in the pool for whoever needs a statement for this connection.
      As a result of running out of statements, DefaultDatabaseLocker causes Oracle to throw an exception "maximum open cursors exceeded". And the broker looses the DB lock and shuts down.

      One solution would be to add a finally block onto the DefaultDatabaseLocker.keepAlive() method to close statement explicitly.

      Attachments

        Activity

          People

            rajdavies Robert Davies
            rajdavies Robert Davies
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: