-->
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: Second level caching and load balancing
PostPosted: Mon May 31, 2010 3:03 am 
Newbie

Joined: Mon May 17, 2010 8:06 pm
Posts: 5
JEE5
JDK 1.6
Hibernate 3.3.0.GA

Currently i have an enterprise application project deployed on weblogic 10.3.2. I am using JPA/Hibernate for ORM mapping and EJB 3.0 for session management.

Below is my persistence.xml

Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
             version="1.0">
             
   <persistence-unit name="EbusinessHibernate" transaction-type="RESOURCE_LOCAL">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>EBUS.XA.DATASOURCE</jta-data-source>
      <!-- The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR -->
      <!--
      <jar-file>../../vehicles.jar</jar-file>
      -->
      <properties>
         <property name="hibernate.dialect" value="au.gov.asic.entity.dialect.InformixDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="validate"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/>
         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
      </properties>
   </persistence-unit>
   
</persistence>


In production, the system architecture setup is four weblogic instances, one ear per server instance, on one server domain and using a load balancer. My question is how do i setup a clusterable cache or what are my options here to cache data as first level cache is per app? I have been looking at hibernate reference documentation on performance but i need to be pointed in the right direction as how to set this up.

Thanks,
Shane.


Top
 Profile  
 
 Post subject: Re: Second level caching and load balancing
PostPosted: Tue Jun 01, 2010 12:02 am 
Newbie

Joined: Mon May 17, 2010 8:06 pm
Posts: 5
After browsing the net and reading up on jboss reference documentation, JBoss cache seems to be the best provider, its transactional and clustered.

Ive read this article Clustered JPA/Hibernate Second Level Caching in JBoss AS 5 http://community.jboss.org/wiki/ClusteredJPAHibernateSecondLevelCachinginJBossAS5 which is very beneficial.

ive seen how to configure entites for caching, caching collections and query result caching.

JBOSS AS supports clustered EJB session beans with annotation
Code:
@org.jboss.ejb3.annotation.Clustered
, is that applicable to weblogic server?

I understand most of the cache properties in persistence.xml but again its jboss specific.
So i want to know if this is enough to run with:
Code:
hibernate.cache.use_second_level_cache=true
hibernate.cache.use_query_cache=true
hibernate.cache.region_prefix=mycache
hibernate.cache.region.factory_class=org.hibernate.cache.jbc2.SharedJBossCacheRegionFactory


Does hibernate.cache.provider_class need to be set?

Shane.


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.