This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Succeeding with AI and have Veljko Krunic on-line!
See this thread for details.
Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Problem updating batch records in Oracle through Java - URGENT

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i have a servlet which reads an excel file and converts it to a vector. after thar i insert the elements of vector into a Oracle table one at a time. If the file is small no problem. But when the file grows i get errors "ORA-01000 maximum open cursor limit exceeded".
1. In the loop of the Vector I have closed all the Statement, PreparedStatement objects so that Oracle cursors associated with it closes.
2. After the Loop I am closing the Connection (using weblogic Connection pool). I cannot close the connection in the loop because I will have to get the connection back in the loop which is very heavy.
My question is even though I am closing all the statemets, preparedstatmets objects inside the loop (which is associated with one insert) why do the cursors associated with them do not get released. In monitoring Oracle i could clearly see that the number of cursors are rising up and they never get released even if the statement objct is closed. i do not want to increase the Parameter in ora.int to bump up the number of cursors. i could use batchUpdate but I have to do some database validations before every insert which cannot be done in the batchUpdate
Any suggestions
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a quick guess, try executing a 'commit' every so often. If Oracle believes that the data has not been committed, it may keep the cursor available for rollback purposes.
 
Your mother was a hamster and your father was a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic