2

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?

pacionet
  • 183
  • 4
  • 15
  • 1
    possible duplicate of [java.sql.SQLException: - ORA-01000: maximum open cursors exceeded](http://stackoverflow.com/questions/12192592/java-sql-sqlexception-ora-01000-maximum-open-cursors-exceeded) – Xstian Sep 22 '14 at 12:20

2 Answers2

1

The oracle message "ORA-01000 - Maximum open cursors exceeded" can be caused by not closing PreparedStatements or ResultSets. 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 PreparedStatements or ResultSets.

Also an intermediate JDBC driver which tracks all PreparedStatements or ResultSets can help to identify the problematic part of the application.

Uwe Plonus
  • 9,803
  • 4
  • 41
  • 48
  • 1
    Thanks but we don t use **PreparedStatement**, we use **Spring JdbcTemplate** *http://docs.spring.io/spring-framework/docs/2.5.x/api/org/springframework/jdbc/core/JdbcTemplate.html) so we don t need to explicity **OPEN** and **CLOSE** connections. Do you have some links for "intermediate JDBC driver" ? – pacionet Sep 22 '14 at 12:33
  • facing same issue with spring jdbc template. Did you figure out the problem? – Deepak N Oct 14 '16 at 04:17
0

It was a bug of that version of Spring. update Spring Library

pacionet
  • 183
  • 4
  • 15