-
1. Re: Ehcache invalidation in Jboss 7
smarlow May 14, 2012 2:22 PM (in response to smarlow)How did you integrate the ehcache provider in? As a module in as7/modules? Can you show the module.xml and the files that you included in that.
Also, what does your persistence.xml look like?
-
2. Re: Ehcache invalidation in Jboss 7
danjee May 14, 2012 2:45 PM (in response to smarlow)Hello,
Thank you for your quick response. I am unable to send my persistentce.xml file today because I left the office. I think my ehcache provider is not fully working and the caching was done by infinispan. Ehcache jar was not loaded as a module but a jar in my application lib folder.
I will get back as soon as I have a much clearer vision of my issue.
Thanks
-
3. Re: Ehcache invalidation in Jboss 7
danjee May 15, 2012 3:17 AM (in response to smarlow)I got it working.
My persistence.xml looks like this:
....
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory" />
<property name="net.sf.ehcache.configurationResourceName" value="ehcache.xml" />
<property name="hibernate.cache.use_query_cache" value="true" />
<property name="hibernate.cache.use_second_level_cache" value="true" />
...
The ehcache is bundled in my ear application in the lib folder. The only problem I faced was with the ehcache.xml configuration file that needed to be loaded in a config folder in jboss modules. Is there any other solution to put the ehcache.xml inside the ear ?
-
4. Re: Ehcache invalidation in Jboss 7
smarlow May 15, 2012 10:35 AM (in response to danjee)Two different questions I think. For the original question, how to invalidate the second level cache entries. For each persistence unit, there will be a EntityManagerFactory associated with the second level cache. You could get the EntitymanagerFactory and try to call EntityManagerFactory.getCache().evictAll(). You can enable TRACE logging for org.hibernate.SQL and see if the entities are loaded from the database or cache on the next application access.
For the other question (about ehcache.xml), where did you put the ehcache.xml file under as7/modules?
-
5. Re: Ehcache invalidation in Jboss 7
danjee May 15, 2012 2:56 PM (in response to smarlow)I've placed the ehcache.xml file in a configuration folder as described here:
https://community.jboss.org/message/721458
and it worked. I was wondering where should I placed the ehcache inside my ear.
Thank you,
Daniel
-
6. Re: Ehcache invalidation in Jboss 7
harrykrishna Oct 1, 2014 6:00 AM (in response to danjee)hi Danie,
We are migrating jboss6 to jboss7.1.1 ,we are using Ehcache .not working.is it possible custom caches at jboss7.if possible can u give the details