-
15. Re: Infinispan Hibernate 2nd level caching not working
smarlow Jan 20, 2012 12:17 PM (in response to nick.sree)I think that <module name="javax.api"/> should be added to the dependencies for as7/modules/org/hibernate/infinispan/main/module.xml.
-
16. Re: Infinispan Hibernate 2nd level caching not working
smarlow Jan 20, 2012 12:31 PM (in response to smarlow)From my unit test, after adding the javax.api dependency, I then get http://pastebin.com/gV8ykuw9.
Unit test and some other (work in progress) changes are here https://github.com/scottmarlow/jboss-as/tree/infinispan_2lc.
-
17. Re: Infinispan Hibernate 2nd level caching not working
pferraro Jan 20, 2012 2:07 PM (in response to nick.sree)I've opened the following jira to allow standalone hibernate applications to use the hibernate infinispan cache manager defined in the Infinispan subsystem:
https://issues.jboss.org/browse/AS7-3386
In summary, you'll be able to specify that a cache-container should start eagerly. This does not mean its caches will start eagerly (they have a separate start attribute), only that they will be defined eagerly.
For the standalone hibernate case, you'll want to indicate that the hibernate cache container should start eagerly. This will ensure that the entity, local-query, and timestamps cache configurations are defined, and that the cache container is available via jndi on startup. Standalone hibernate applications will then be able to fully leverage JndiInfinispanRegionFactory.
-
18. Re: Infinispan Hibernate 2nd level caching not working
matt_filion Jan 20, 2012 4:24 PM (in response to smarlow)The nightly build did not fix the issue for me, it is still not able to locate the CacheContainer via JNDI.
-
19. Re: Infinispan Hibernate 2nd level caching not working
nick.sree Jan 23, 2012 1:31 AM (in response to pferraro)Hi Paul,
Thanks for addressing this issue, can you please tell me is there anything to do or how to start the hibernate cache container eagerly.?
-
20. Re: Infinispan Hibernate 2nd level caching not working
nick.sree Jan 23, 2012 1:35 AM (in response to smarlow)Hi Scott,
Thanks for your suggestion, we can do it like adding dependency to module.xml but my doubt is when we want to upgrade Jboss AS 7 version, it wil be a pain. So i guess Jboss AS 7 folks have to take a call on this.
-
21. Re: Infinispan Hibernate 2nd level caching not working
pferraro Jan 23, 2012 11:34 AM (in response to nick.sree)You'll have to wait for this pull request:
https://github.com/jbossas/jboss-as/pull/1189
Then you would modify the hibernate cache-container accordingly:
<cache-container name="hibernate" start="EAGER">
<!-- ... -->
</cache-container>
This will ensure that the cache container is bound to jndi on startup and will have all of its cache's defined before your application tries to reference them via the JndiInfinispanRegionFactory.
-
22. Re: Infinispan Hibernate 2nd level caching not working
romankr Jan 26, 2012 3:36 AM (in response to pferraro)Looks like there is bug with processing attribute "start" in cache container configuration - value of this attribute parsed as boolean (in InfinispanSubsystemXMLReader)
-
23. Re: Infinispan Hibernate 2nd level caching not working
smarlow Jan 26, 2012 1:05 PM (in response to romankr)1 of 1 people found this helpfulDid you add start="eager" as shown below?
<subsystem xmlns="urn:jboss:domain:infinispan:1.1" default-cache-container="hibernate">
<cache-container name="hibernate" start="eager" default-cache="local-query">
<local-cache name="entity">
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="local-query">
<transaction mode="NON_XA"/>
<eviction strategy="LRU" max-entries="10000"/>
<expiration max-idle="100000"/>
</local-cache>
<local-cache name="timestamps">
<transaction mode="NON_XA"/>
<eviction strategy="NONE"/>
</local-cache>
</cache-container>
</subsystem>
-
24. Re: Infinispan Hibernate 2nd level caching not working
brentdouglas Jan 26, 2012 10:29 PM (in response to romankr)That bug has been fixed. https://github.com/jbossas/jboss-as/commit/f52ec77a185f063c48e7759b86a756060b1368f9
I am now able to use JndiRegionFactory on a bundled hibernate 3 deployment after adding start="EAGER" jndi-name="java:jboss/infinispan/hibernate" to standalone-ha.xml
-
25. Re: Infinispan Hibernate 2nd level caching not working
mpgong Jan 30, 2012 12:12 PM (in response to nick.sree)Any new updates. I would like to configure persistence to use the 2nd level cache but i was only able to get to a point where it is complaining about
Unable to retrieve CacheManager from JNDI [java:jboss/infinispan/hibernate]
-
26. Re: Infinispan Hibernate 2nd level caching not working
alesj Jan 30, 2012 12:15 PM (in response to mpgong)1 of 1 people found this helpfulThe jndi name has changed recently -- at least in trunk/master.
It's java:jboss/infinispan/container/hibernate now.
-
27. Re: Infinispan Hibernate 2nd level caching not working
nick.sree May 1, 2012 4:19 AM (in response to alesj)Now i'm getting an error
Caused by: java.lang.NullPointerException
at org.hibernate.cache.infinispan.InfinispanRegionFactory.getCache(InfinispanRegionFactory.java:445) [hibernate-infinispan-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.cache.infinispan.InfinispanRegionFactory.buildEntityRegion(InfinispanRegionFactory.java:198) [hibernate-infinispan-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:339) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
-
28. Re: Infinispan Hibernate 2nd level caching not working
smarlow May 1, 2012 9:23 AM (in response to nick.sree) -
29. Re: Infinispan Hibernate 2nd level caching not working
nick.sree May 2, 2012 2:42 AM (in response to smarlow)Great Scott... it worked with lastest build... Thanks a lot for all your support even it took quite a longgg time . So when i can expect the Final release ?