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

                 Key: AMQ-1702
                 URL: https://issues.apache.org/activemq/browse/AMQ-1702
             Project: ActiveMQ
          Issue Type: Bug
          Components: Message Store
    Affects Versions: 5.0.0
            Reporter: Rob Davies
            Assignee: Rob Davies
             Fix For: 5.1.0


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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to