aspose file tools*
The moose likes JDBC and the fly likes ORA-01000: maximum open cursors exceeded Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ORA-01000: maximum open cursors exceeded " Watch "ORA-01000: maximum open cursors exceeded " New topic
Author

ORA-01000: maximum open cursors exceeded

ujjwal soni
Ranch Hand

Joined: Mar 28, 2007
Posts: 403
I am getting this below error.

Oracle/PLSQL: ORA-01000 Error

--------------------------------------------------------------------------------
Error:
ORA-01000: maximum open cursors exceeded


I am using hibernate with struts framework.

I am doing this in finally clause of each dao.


please help


Cheers!!!
Ujjwal B Soni <baroda, gujarat, india> <+919909981973>
"Helping hands are better than praying lips......"
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
ujjwal soni wrote:

Bad code. If rs is null, connection will never be closed.
And how about statements?
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3704
    
    5

Actually even if rs is not null, it can still throw an exception preventing the connection from ever being closed. Each statement in the finally should have a try/catch around them. I wrote an article on closing JDBC resources some time back.


My Blog: Down Home Country Coding with Scott Selikoff
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
(Prepared)Statements are also expensive resources.
If you use connection pooling, the connection.close() won't close any opened Statements.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ORA-01000: maximum open cursors exceeded