oracle-databasejdbcconnection-leaksucp

Oracle UCP Pool leaking cursor?


Our application has been using OracleDataSource successfully for several years and we are now evaluating switching to the new Oracle Universal Connection Pool (UCP).

With the new UCP Pool, our application runs into ORA-0100: Maximum open cursors after some time.

Some people seem to have had similar problems:

Is there any known workaround / fix?

Note: We do close sessions and statements correctly and are following all known JDBC/Hibernate best practices. The app runs 24/7 and the data access layer code is >8 year old and has been exhaustively tested. We are using Oracle 12c.


Solution

  • Well, it turned out we though we were following all known best practices. In some places we were using ScrollableResult without closing them properly. In this case it apparently leaks the underlying cursor, even after the hibernate session is closed. We fixed all occurences we found in the code and as an additional defensive measure we configured the opion maxConnectionReuseTime of the pool to ensure connection are renewed periodically.

    Note: it didn't took us one year to find the problem, only a few days, I simply forgot to answer the question after we figured out the problem...