Tuesday, April 19, 2016

OpenJpa second level caching


  1.  http://openjpa.apache.org/builds/1.2.3/apache-openjpa/docs/ref_guide_caching.html
  2. http://openjpa.apache.org/builds/1.2.3/apache-openjpa/docs/ref_guide_caching.html#ref_guide_cache_pmevict
  3. https://www.ibm.com/support/knowledgecenter/was_beta/com.ibm.websphere.base.doc/ae/tejb_datcacheconfig.html
  4. https://www.ibm.com/support/knowledgecenter/SSAW57_8.0.0/com.ibm.websphere.nd.doc/info/ae/ae/rdyn_openjpa.html
  5. http://www.developer.com/java/using-second-level-caching-in-a-jpa-application.html
  6. http://docs.oracle.com/javaee/6/tutorial/doc/gkjjj.html
  7. http://blog.jhades.org/setup-and-gotchas-of-the-hibernate-second-level-and-query-caches/
  8. http://www.javalobby.org/java/forums/t48846.html
  9. http://docs.jboss.org/hibernate/orm/3.5/reference/en/html/performance.html
  10. http://www.coderpanda.com/jpa-caching/
  11. http://tech.puredanger.com/2009/07/10/hibernate-query-cache/

 When Query cache is bypassed?
 The evictAll method with no arguments clears the cache.
 Most caches are of limited size. Pinning an identity to the cache ensures that the cache will not kick the data for the corresponding instance out of the cache, unless you manually evict it.
 StoreCache Usage

import org.apache.openjpa.persistence.*;

...

OpenJPAEntityManagerFactory oemf = OpenJPAPersistence.cast(emf);
StoreCache cache = oemf.getStoreCache();
cache.pin(Magazine.class, popularMag.getId());
cache.evict(Magazine.class, changedMag.getId());



No comments:

Post a Comment