Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old February 3rd, 2005, 03:43 PM
sqgs sqgs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 55 sqgs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 21 m 24 sec
Reputation Power: 4
Please help: maximum open cursors exceeded

I had an web application to add filenames (string type) into a table. Some times I need to add 60000 filenames into this table. This table has a trigger. Whenever a new filename added, it assigns an ID to it.

When I tested it, there is an oracle error :maximum open cursors exceeded. Please help me to solve this problem. Did I add two many into this table? should I remove the trigger?

thanks.

Reply With Quote
  #2  
Old February 3rd, 2005, 04:29 PM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 972 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 49 m 10 sec
Reputation Power: 57
You don't say how you add the data. Are you using a SQL script, some kind of GUI SQL frontend, a self-written program. If the latter which programming language?

But usually this happens when you don't close/free resources in your client code, e.g. in JDBC this would be Statement.close() and ResultSet.close() which - when missing - can cause this error.

Thomas

Reply With Quote
  #3  
Old February 4th, 2005, 09:25 AM
sqgs sqgs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 55 sqgs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 21 m 24 sec
Reputation Power: 4
I used JDBC and JSP. A jsp page gets the list of filenames then it opened a connection and execute some sql statements (60000 insert statement, for example). then it closed connection.

I figured it probably because the number for open cursors are too low. I can either increase the open cursors or in my code, I closed the connection after a number of insert statement executed, and reopen another one.

Does higher number of Open Cursors good or bad?

Reply With Quote
  #4  
Old February 4th, 2005, 10:27 AM
shammat shammat is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Oct 2003
Location: Munich, Bavaria
Posts: 972 shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level)shammat User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 17 h 49 m 10 sec
Reputation Power: 57
Quote:
Originally Posted by sqgs
then it closed connection.

Do you explicitely close the statements (and ResultSets) before closing the connection?

Reply With Quote
  #5  
Old February 10th, 2005, 09:12 AM
sqgs sqgs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 55 sqgs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 21 m 24 sec
Reputation Power: 4
Quote:
Originally Posted by shammat
Do you explicitely close the statements (and ResultSets) before closing the connection?


I didn't use ResultSets. My code is lik this:

*********************
Driver MM_driver = (Driver)Class.forName(MM_editDriver).newInstance();
Connection MM_connection = DriverManager.getConnection(MM_editConnection,MM_editUserName,MM_editPassword);
for(i=1; i< totalNum; i++) {
PreparedStatement MM_editStatement = MM_connection.prepareStatement(qstr[i]);
MM_editStatement.executeUpdate();
}
MM_connection.close();
***********************

Maybe I should remove the "PreparedStatement" line out of the For loop.

I also tried using Perl to do 60000 inserts, and it was fine. So it is the problem with limited number of open cursor. Something is wrong with the java cod.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Please help: maximum open cursors exceeded


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway