Difference between MemoryConstrianedCacheManager and EhCacheManager

434 views Asked by At

I have more than two web applications deployed in tomcat. One of the application used apache shiro for session management . I need to get the session ID from the 1st application and use it in my other applications.

For Example

1st Application example uses MemoryConstrainedCacheManager

Shiro.ini

cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $cacheManager

For 2st Application , if i use the same configuration of 1st

cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $cacheManager

SSO session management is not working. I need to login again .

If i use EhcacheManager in both the application by configuring cache in xml its working,

ssoCacheManager = org.apache.shiro.cache.ehcache.EhCacheManager 
ssoCacheManager.cacheManagerConfigFile = classpath:ehcache.xml
securityManager.cacheManager = $ssoCacheManager 

What is the difference between MemoryConstrained and EHCache manager ? Can i use memory constrained cache manager to store the session ID in tomcat container and use it in other web applications.

1

There are 1 answers

0
Brian Demers On

EHCache has a lot of features, take a look at the site. The MemoryConstrainedCacheManager is basically just a cache backed by a limited size Map.