• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Caching Entities

 
jyoti j singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

In my application in heap dump I have found a map of org.hibernate.cache.HashtableCache it has couple of entries and the one with highest memory consumed one is  a collection of one of the entity.



Do I need to add any step to avoid Cache in Hibernate once serviceMethod is out of scope?
this is one place where this entity is used, I am looking into other places where same entity is used and aiming to clear cache once called any service method is complete.
thanks.
 
jyoti j singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed following important statement



not sure how to edit my previous post so adding new...
 
jyoti j singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


after following step, I wish to detach entity from managed state
        entityManager.persist(entity);


I can see      entityManager.clear(); but it acts on all managed entities.

I can see         entityManager.detach(entity); in online API doc but in my application         entityManager.detach(entity); is not showing 

How can I detach a given entity, any suggestion please?




 
jyoti j singh
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Current jar file is > ejb3-persistence.jar
& meta-inf info is >
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 14.0-b16 (Sun Microsystems Inc.)
Built-By: hibernate.org
Specification-Title: EJB 3.0
Specification-Version: 3.0 Final Release (1.0.2.GA)
Specification-Vendor: Sun Microsystems, Inc.
Implementation-Title: EJB
Implementation-Version: 3.0 Final Release (1.0.2.GA) January 5 2011
Implementation-Vendor: hibernate.org

Which jar I should use instead of  ejb3-persistence.jar for JPA2 implementation 
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic