-->
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.  [ 6 posts ] 
Author Message
 Post subject: maximum open cursors in oracle
PostPosted: Mon Nov 10, 2003 7:52 pm 
Beginner
Beginner

Joined: Wed Oct 22, 2003 11:26 am
Posts: 31
Hi,

I am using Hibernate 2.0.3. I am fetching some records from oracle9i database. And after some time i get an error as maximum open cursors exceeded.
Here is the code :
Query q =
session.createQuery("from UserRoles as userRoles where userRoles._userId = ?");
q.setString(0, userName);
Iterator userRolesIter = q.iterate();
while (userRolesIter.hasNext()) {
userRoles = (UserRoles) userRolesIter.next();
role = getRole(userRoles.get_roleId(), session);
}
session.close();
In all the methods i close session in the end. Is there anything else to be done. In Session API it states that close() method closes JDBC connection and cleans up.
Please help.

Rajan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 7:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This is actually in the FAQ, but I admit that the FAQ isn't very clear.

http://www.hibernate.org/117.html#A11

The Oracle JDBC driver doesn't like prepared statement caching very much. Disable the prepared statement cache in whatever connection pool you are using.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 10:31 am 
Beginner
Beginner

Joined: Mon Mar 29, 2004 12:41 pm
Posts: 26
How to disable the statement caching in oracle pleeaasse ?? I can't do it...

Is this by code, or in the hibernate config file ?

Thank you ! =)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 4:16 pm 
Beginner
Beginner

Joined: Mon Jan 12, 2004 3:39 pm
Posts: 23
I think you have to disable the caching in the hibernate.cfg.xml. I'm having the same problem here. Add this property to disable preparedStatement caching : hibernate.statement_cache.size=0


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 27, 2004 6:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
This is only for the builtin pool which should not be used anyways. Look at the javadoc for net.sf.hibernate.cfg.Environment all config parameters are listed and explained there.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 28, 2004 3:19 am 
Beginner
Beginner

Joined: Mon Mar 29, 2004 12:41 pm
Posts: 26
Really Thank you all...

=)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.