aspose file tools
The moose likes JDBC and the fly likes java jdbc and oracle - maximum open cursors exceeded Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "java jdbc and oracle - maximum open cursors exceeded" Watch "java jdbc and oracle - maximum open cursors exceeded" New topic
Author

java jdbc and oracle - maximum open cursors exceeded

anagha patankar
Ranch Hand

Joined: Dec 26, 2005
Posts: 53
I have some jdbc code that is retrieving data from Oracle
In my method I use a Prepared statement
However I dont close the prepared statement
To test it I ran this in a loop and sure enough I got an exception :
"ORA-01000: maximum open cursors exceeded"

My question is in case of a managed environment ( code deployed on a J2EE applications erver using connection pools ) :
what happens to the application ?
will it never be able to fire any sql to the database unless the connection is closed / recycled ( assume that there is only 1 connection in the pool )
I am assuming as connections in pool are not really closed - so the oracle session will be alive

Thanks,
anagha
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
I think it depends on the pool configuration.
Most of the pools can be configured to validate if connection is erroneous by executing a validation query,
and in case of errors - the pool closes that connection and reopens a new one.
When the session is closed, oracle closes all cursors opened within this session.
Why don't you want to close statements ?
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: java jdbc and oracle - maximum open cursors exceeded
 
Similar Threads
maximumm cursors exceeded
PreparedStatement's - how do you use them CORRECTLY?
Problem updating batch records in Oracle through Java - URGENT
Issue after Migration from WAS4 to WAS5.1
Closing Statement object prior to committing