-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to deal with large amount records in EJB3
PostPosted: Fri Jul 01, 2005 12:44 am 
Newbie

Joined: Fri Jul 01, 2005 12:37 am
Posts: 1
When loads large amount of records, we can clear the session cache by calling session.clear() every for say 500 records to release the memory in Hibernate Session.

But with EJB3 implmenetation, there is no similar method I can call. What should I do to avoid the memory leak?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 01, 2005 9:49 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
2 solutions.
em.getTransaction().commit() does the clear for you (unless you use an Extended persistence context)

( (HibernateEntityManager) em).getSession().clear();

_________________
Emmanuel


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