Reputation: 361
we have a Java Enterprise Application running on Weblogic Server 12c using Spring JDBC 3.2.5 to access Oracle 11gR2 Database. In production environment after some time we got this exception: "ORA-01000 - Maximum open cursors exceeded" and server instance need to be restarted; it seems that open cursors increase more and more until they reach the maximum threshold set on Oracle. Increasing the threshold didn t solve the problem. We check the (very large) source code but we didn t find any point where we miss closing connection, at the moment; moreover we usually don t open and close connections but we use Spring JdbcTemplate to handle database interaction. Could be a Spring problem? Any hints?
Upvotes: 2
Views: 4057
Reputation: 9974
The oracle message "ORA-01000 - Maximum open cursors exceeded" can be caused by not closing PreparedStatement
s or ResultSet
s. Each PreparedStatement
or ResultSet
is a cursor in the Oracle database.
To circumvent this error for the short term you can increase the limit of open cursors in the database (but sooner or later it will occur again).
To circumvent this error really you have to audit the complete application and close all opened PreparedStatement
s or ResultSet
s.
Also an intermediate JDBC driver which tracks all PreparedStatement
s or ResultSet
s can help to identify the problematic part of the application.
Upvotes: 1