• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

jdbc

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using preparedStatement to execute some queries .
and inspite of closing result, statement i am getting
"maximum cursors open exceeded".
What can be the reason?
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If Oracle it your database, This might help:
even after resultset.close(), statement.close(),resultset = null and statement=null, all cursors were not being closed in the DB. A service call in to oracle seemed to imply that there were some bugs in their jdbc implementations - any Statement you created would internally spawn cursors in the db (from their drivers) that weren't getting closed. apparently this has been fixed in the 8.1.7 release, classes12.zip. I still found that we needed to set our open_cursors (in init.ora, on the db server) to a fairly high number (i think default is 40 or something), and do a forced conn.rollback() every time we returned the Connection interface object back to our connection pool.
another way to clean up the cursors is to close the connection. But this process is too time consuming for our implementation.
seemed to help... but not totally solve
Jamie
 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you use prepared statments it will reuse the cursors
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic