setting setShared(true) on EhCacheManagerFactoryBean

View: New views
2 Messages — Rating Filter:   Alert me  

setting setShared(true) on EhCacheManagerFactoryBean

by swe :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I was looking at Spring's EhCacheManagerFactoryBean and there is a method called setShared(boolean shared). According to the API, setting this value to true means that the cacheManager should be shared (as a singleton at the VM level).

In my case, does this mean that all web applications running on a single Tomcat instance (one server) will share the same cacheManager? This is what I thought so I ran a simple test. I deployed AppA and AppB both using EhCacheManagerFactoryBean (setShared(true)). I populated one of my cache object using AppA and then issued getStatistics() from AppB on the same cache object. I thought that AppB would give me the stats according to the objects I inserted with AppA. This was not the case. What should the expected behaviour be? There might be an error in my code but before I start debugging I just want to make sure I've understood this correctly

Many thanks
S

Re: setting setShared(true) on EhCacheManagerFactoryBean

by gregluck :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Erik

I did not write the Spring class so I am not sure what it does. Which Spring package is it in?

On 31/05/2008, at 5:07 PM, swe wrote:


Hi,

I was looking at Spring's EhCacheManagerFactoryBean and there is a method
called setShared(boolean shared). According to the API, setting this value
to true means that the cacheManager should be shared (as a singleton at the
VM level).

In my case, does this mean that all web applications running on a single
Tomcat instance (one server) will share the same cacheManager? This is what
I thought so I ran a simple test. I deployed AppA and AppB both using
EhCacheManagerFactoryBean (setShared(true)). I populated one of my cache
object using AppA and then issued getStatistics() from AppB on the same
cache object. I thought that AppB would give me the stats according to the
objects I inserted with AppA. This was not the case. What should the
expected behaviour be? There might be an error in my code but before I start
debugging I just want to make sure I've understood this correctly

Many thanks
S
--
View this message in context: http://www.nabble.com/setting-setShared%28true%29-on-EhCacheManagerFactoryBean-tp17572649p17572649.html
Sent from the Ehcache mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list

Regards


Greg Luck


skype: gregrluck
yahoo: gregrluck
mobile: +61 408 061 622




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
ehcache-list mailing list
ehcache-list@...
https://lists.sourceforge.net/lists/listinfo/ehcache-list