• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Peter Rooke
  • Himai Minh
  • Piet Souris
  • Mikalai Zaikin

java jdbc and oracle - maximum open cursors exceeded

Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
Politics is a circus designed to distract you from what is really going on. So is this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic