-
1. Re: Wildfly with Hibernate and Infinispan
pferraro Jan 21, 2015 11:48 AM (in response to tollrakesh)You should use WildFly's hibernate region factory, which integrates with the Infinispan subsystem.
e.g.
hibernate.cache.region.factory_class = org.jboss.as.jpa.hibernate4.infinispan.InfinispanRegionFactory
You can omit the "hibernate.cache.infinispan.cachemanager" property, as it is not relevant to WildFly's region factory implementation.
-
2. Re: Wildfly with Hibernate and Infinispan
tollrakesh Jan 21, 2015 12:00 PM (in response to pferraro)Hi Paul,
Thank you for the reply. I think I tried this as well along the way. In this case, I'm not able to locate that class under WildFly modules.
When I try to use it directly, I get the class not found exception
Caused by: org.hibernate.HibernateException: could not instantiate RegionFactory [org.jboss.as.jpa.hibernate4.infinispan.InfinispanRegionFactory]
Is there any specific library I should be importing?
Thanks in advance.
-
3. Re: Wildfly with Hibernate and Infinispan
smarlow Jan 21, 2015 12:25 PM (in response to tollrakesh)What happens if you don't set hibernate.cache.region.factory_class? Is your application using JPA or the native Hibernate api? For JPA, org.jboss.as.jpa.hibernate4.infinispan.SharedInfinispanRegionFactory is used. During deployment, WildFly sets the factory_class automatically if hibernate.cache.use_second_level_cache is set to true.
-
4. Re: Wildfly with Hibernate and Infinispan
pferraro Jan 21, 2015 2:20 PM (in response to smarlow)1 of 1 people found this helpfulI think he's using the hibernate API. I would bet that the class visibility issue is due to bundling the hibernate jar in the deployment, rather than exporting the WildFly's hibernate module to the deployment. See: https://docs.jboss.org/author/display/WFLY8/JPA+Reference+Guide#JPAReferenceGuide-UsingtheInfinispansecondlevelcache
smarlow There's a mistake in the documentation - the "hibernate.cache.infinispan.cachemanager" property should be removed from the sample configuration since is not read by jipijapa's region factory implementation.
-
5. Re: Wildfly with Hibernate and Infinispan
tollrakesh Jan 21, 2015 2:27 PM (in response to tollrakesh)Hi Paul.. the issue seems to be fixed. I started to get passed this issue but started to face another one as below
Spring IllegalStateException: A JTA EntityManager cannot use getTransaction()
I'm currently researching on that issue. Migration seems to be painful
-
6. Re: Wildfly with Hibernate and Infinispan
smarlow Jan 22, 2015 11:36 AM (in response to tollrakesh)There are some notes on migration of Spring applications. Also, http://snowdrop.jboss.org might be interesting for you.