-
1. Re: cache is Terminiated for unknown reasons
pisadr Apr 9, 2012 5:33 AM (in response to dex80526)Dex,
Can you check whether there is any call to cache.stop() in the code? If you call stop() on cache or cacheContainer and try to access the cache, you will get this error.
If the cache is part of web application, make sure to call cacheContainer.stop() while un-deploying the webapp.
-
2. Re: cache is Terminiated for unknown reasons
dex80526 Apr 10, 2012 3:02 PM (in response to pisadr)Thanks Pisa. I'll look into this.
A related question about start/stop cahces: Do I need to call start() on cache manager first to call startCache(s) for named caches? Or do I need to call startCache(s) after call start() on cacheManager? Right now, it seems that calling start() on cacheManager is not required if startCache() method is called.
-
3. Re: cache is Terminiated for unknown reasons
galder.zamarreno Apr 11, 2012 11:24 AM (in response to dex80526)It's best if you call start() on the cache manager first, or you create the cache manager with a constructor which already starts the cache manager (maybe you already do this...)
-
4. Re: cache is Terminiated for unknown reasons
dex80526 Apr 11, 2012 12:03 PM (in response to galder.zamarreno)Galder, thanks for the response.
I am trying to use start() on cacheManager right now.
It seems that the method startCaches( String ...) may have potential issues when you have many named caches configured. The issue ("Unable to aquire lock..) I ran into may be related to this method. I used the startCaches( ..) in my earlier code.
Right now, what I am doing is that I create a DefaultCacheManager, and call start() on the cacheManager. I do not call startCache() or startCaches() on named caches, since all defined caches in the same cache manager have the same life cycle.
I am testing these changes now.
Do you see any problems?
-
5. Re: cache is Terminiated for unknown reasons
galder.zamarreno Apr 16, 2012 3:53 AM (in response to dex80526)No, that shouldn't be a problem. startCaches() is just a way to start caches in advance, but you can get the same effect calling getCache() on each cache when necessary.
I'm interested though in the "Unable to aquire lock.." issue. Do you have a unit test for this?
-
6. Re: cache is Terminiated for unknown reasons
dex80526 Apr 16, 2012 4:38 PM (in response to galder.zamarreno)No, I do not have a unit test to recreat "Unable to acquire lock" yet. I'll try to create one. Right now, I ran into many other issues (as posted separately), and try to work around of them. I am thinking the startCaches(list of cache names) method behaves differently. The code seems putting starting each cache in a separate thread. thanks.