-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: OPEN CURSORS EXCEEDED Oracle error..
PostPosted: Wed Aug 25, 2004 1:28 am 
Newbie

Joined: Wed Aug 25, 2004 1:13 am
Posts: 1
Hi all,

Been receiving the above open cursors exceeded error in our application. After initial investigation, we noticed that even afer the statement execution, the cursors are open in the database.

Below is the sample application code,

public void addAudit(String loginID)
{
Session session = ConnectionFactory.getInstance().getSession();
Audit at = new Audit();
try
{
Calendar rightNow = Calendar.getInstance();
Date dt = new Date(System.currentTimeMillis());
at.setAuditID(-1);
at.setUserID(loginID);
at.setAuditType("LOGIN");
at.setUpdateTime(dt);

//Add to sec_audit table
Transaction txn = session.beginTransaction();
session.save(at);
logObj.info("saving into SEC_AUDIT loginid=" + loginID);
txn.commit();

}
catch (HibernateException e)
{
System.err.println("Hibernate Exception" + e.getMessage());
logObj.error(e);
throw new RuntimeException(e);
}
finally
{
try
{
session.close();
}
catch (HibernateException e)
{
System.err.println("Hibernate Exception" + e.getMessage());
logObj.error(e);
throw new RuntimeException(e);
}
}
}

So just wondering whether we are doing something wrong in the code, that prevents closing the cursor.

we tried the option - hibernate.statement_cache.size=0 in the properties file as well.. No luck..

Any help will be much appreciated.

Kind Regards
Shekar.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 27, 2004 10:44 pm 
Regular
Regular

Joined: Fri Dec 12, 2003 2:09 pm
Posts: 84
Location: San Francisco, USA
Which version of Oracle's JDBC drivers are you using?

I'm seeing this right now using their 10g (10.1.0.2.0) drivers. I'm going to test their latest 9i (9.2.0.4) drivers soon and will let you know what I find.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 27, 2004 11:27 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
There is oracle parameter open_cursors - increase it


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 2:48 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
this error can occur if you're taking care of how transaction are finished n you app.

Typically i had this problem with a developper who wasn't using beginTransaction for read only queries.

Hope this can help...

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 3:09 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
http://www.orafaq.com/error/ora-01000.htm
this must help to find the cause, It takes a few minutes to fix this kind of problems, just use error code for search.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2004 3:26 pm 
Regular
Regular

Joined: Fri Dec 12, 2003 2:09 pm
Posts: 84
Location: San Francisco, USA
Our database instances are typically set to 500 open cursors, which should be more than adequate for our application (especially in dev and testing environments). We follow standard txn management best practices.

Our particular problem was because of DBCP prepared statement caching, as discussed in the FAQ:

http://hibernate.org/120.html#A9

I'm going to experiment with Oracle JDBC's implicit statement caching:

http://download-west.oracle.com/docs/cd ... m#i1071993

Anyone have experience with this?


Top
 Profile  
 
 Post subject: An open JIRA Issue ?
PostPosted: Mon Sep 04, 2006 11:28 am 
Newbie

Joined: Thu Apr 21, 2005 4:59 am
Posts: 15
Isn't the problem in hibernate code itself ?

I have found this open issue :
http://opensource.atlassian.com/project ... e/HHH-2006


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.