We have two spring based web applications and we are using JPA (Hibernate provider) with EhCache as secondarly level cache.
We have some entities that are common between both the applications.
now we want to have a cache at business layer and we thought of going with Jboss Cache and bind it to Jndi so that both each application is in sync with updates.
CacheFactory<String, Object> factory = new DefaultCacheFactory<String, Object>(); cache = factory.createCache("jboss-cache.xml"); cache.create(); cache.start(); JndiTemplate jndiTemplate = getJndiTemplate(); jndiTemplate.bind(JBOSS_CACHE_JNDI_NAME, cache);