-->
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.  [ 1 post ] 
Author Message
 Post subject: Transactions with Infinispan as second level cache
PostPosted: Wed May 29, 2013 4:21 pm 
Newbie

Joined: Mon Mar 12, 2012 11:55 am
Posts: 2
I've been trying to use Infinispan as a second level cache and am having trouble getting it to participate in a transaction. Originally I thought my problem was with Infinispan so I posted a question on the Infinispan forum. You can see the full details here:

https://community.jboss.org/message/819697

I was working with this page (among others) to try to get this working:

https://docs.jboss.org/author/display/ISPN/Using+Infinispan+as+JPA-Hibernate+Second+Level+Cache+Provider

It specifically mentions the need to set hibernate.transaction.manager_lookup_class and hibernate.transaction.factory_class. Which I have been doing:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                         "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
   <session-factory name="TestPersistenceUnit">
      <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
      <property name="hibernate.generate_statistics">false</property>
      <property name="hibernate.cache.use_second_level_cache">true</property>
      <property name="hibernate.hbm2ddl.auto">create</property>
      <property name="hibernate.show_sql">false</property>
      <property name="hibernate.cache.region.factory_class">org.jboss.as.jpa.hibernate4.infinispan.InfinispanRegionFactory</property>
      <property name="hibernate.cache.infinispan.cachemanager">java:jboss/infinispan/container/hibernate</property>
      <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
      <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
      <class-cache class="com.testpackage.entity.MyEntity"
         include="all" usage="transactional" />
   </session-factory>
</hibernate-configuration>


Eventually in a moment of frustration I tried changing these values to nonsense to see if they were actually doing anything:

Code:
      <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookupblah</property>
      <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactoryblah</property>


And the app deployed and worked just fine which surprised me (still didn't participate in transactions though).

Do I have the correct configuration in my original hibernate config to use Infinispan in a transactional manner as my second level cache provider?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.