Using JUNIT, I am calling a stored procedure java side several times (lets say 10 times). After some calls (lets say 7 seven times), I have a java.sql.SQLException: ORA-01000: too many cursors open
I have the same number of tests Oracle side in a plsql script : I have no problem when I call this procedure 10 times or 20 times, all of the cursors I used are closed after I use them.
So the problem seem to be java side, though the error is an oracle code (???).
Java side, I call the procedure with a statement and get the resultSet :
cstmt = c.prepareCall("CALL myStoredProcedure(?,?,?,?)");
cstmt.setDate(1, sDate);
cstmt.setString(2, myVar);
cstmt.setString(3, myVar2);
cstmt.registerOutParameter(4, java.sql.Types.ARRAY, "My_TYPE_ITEMS");
cstmt.execute();
...
rs.close();
cstmt.close();
The exception happens on the execute command for sure.
Any idea ?