hibernate 4.1.9 and infinispan - standalone
lazydog256 Feb 8, 2013 1:36 PMSo I've tried to follow the instructions described in https://docs.jboss.org/author/display/ISPN/Using+Infinispan+as+JPA-Hibernate+Second+Level+Cache+Provider#UsingInfinispanasJPA-HibernateSecondLevelCacheProvider-DefaultConfigurationExplained but they appear to be out of date.
I'm trying to run hibernate 4.1.9 with infinispan 5.2.0.Beta3 as a cache in a standalone environ. Given the documentation, I setup my config as such:
<property name="hibernate.cache.use_query_cache">true</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.infinispan.InfinispanRegionFactory</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
But it appears using org.hibernate.transaction.JTATransactionFactory is deprecated in hibernate 4.0 according to http://docs.jboss.org/hibernate/orm/4.1/devguide/en-US/html_single/ under the section "2.2.5. Physical Transactions - Legacy". I went ahead and tried this config anyways, and got this exception:
Caused by: org.infinispan.CacheException: This is transactional cache but no transaction manager could be found. Configure the transaction manager lookup properly.
at org.infinispan.factories.TransactionManagerFactory.construct(TransactionManagerFactory.java:74)
at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:290)
at org.infinispan.factories.ComponentRegistry.getOrCreateComponent(ComponentRegistry.java:161)
at org.infinispan.factories.AbstractComponentRegistry.invokeInjectionMethod(AbstractComponentRegistry.java:246)
at org.infinispan.factories.AbstractComponentRegistry.access$000(AbstractComponentRegistry.java:86)
at org.infinispan.factories.AbstractComponentRegistry$Component.injectDependencies(AbstractComponentRegistry.java:811)
at org.infinispan.factories.AbstractComponentRegistry.registerComponentInternal(AbstractComponentRegistry.java:220)
at org.infinispan.factories.ComponentRegistry.registerComponentInternal(ComponentRegistry.java:170)
at org.infinispan.factories.AbstractComponentRegistry.registerComponent(AbstractComponentRegistry.java:175)
at org.infinispan.factories.AbstractComponentRegistry.getOrCreateComponent(AbstractComponentRegistry.java:295)
a
I noticed there isn't any org.hibernate.transaction.JBossTransactionManagerLookup in my classpath (i'm running in standalone), so I changed
so changed from:
<property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
to:
<property name="hibernate.transaction.manager_lookup_class">org.infinispan.transaction.JBossTransactionManagerLookup</property>
and got this exception:
Caused by: org.hibernate.service.jta.platform.spi.JtaPlatformException: Unable to build org.hibernate.service.jta.platform.internal.TransactionManagerLookupBridge from specified org.hibernate.transaction.TransactionManagerLookup implementation: org.infinispan.transaction.JBossTransactionManagerLookup
What do to? Do I need to add JBossTM in standalone mode ( http://www.jboss.org/jbosstm )? I downloaded 'JBossTS 4.17.3.Final' and couldn't find any classes called "*Lookup.java" under JBossTA nor JBossTS.
Am i misreading the initial documentation at https://docs.jboss.org/author/display/ISPN/Using+Infinispan+as+JPA-Hibernate+Second+Level+Cache+Provider#UsingInfinispanasJPA-HibernateSecondLevelCacheProvider-DefaultConfigurationExplained ? It appears to be out-of-date for the current version of hibernate.
Thanks!