[
https://issues.jboss.org/browse/ISPN-905?page=com.atlassian.jira.plugin.s...
]
Patrick McFarland commented on ISPN-905:
----------------------------------------
Yeah, re-entrant stuff would be problematic. It obviously should be implemented in a way
that actually makes sense for how Infinispan works internally.
Basically, I do not want to use JGroups directly or do stupid tricks with Infinispan
events. Since my caches specifically started from my application are stores for my
objects, the only way to delete the object is to delete the cache that backs them too (as
in, CacheManager.remove()); however, there is no way to force my application to _not_
re-create caches.
As in, if I hand out instances of my objects (which front end the caches), there is no way
to perform an analog of .remove() on them unless I can tell Infinispan to _never_
re-create the cache that backs my objects if it doesn't already exist.
So, if I do MyObjectManager.remove(myObject) (yes, my API looks familiar), which calls
CacheManager.remove(cache), there is no sane way to tell Infinispan that I do not wish to
re-create the cache I just removed, and there is no way for me to check from within
MyObject's logic that the backing cache is still valid (in which if its not valid, I
would raise an exception).
To me, using an API that works like cacheExists()/getCacheIfExists() is the most flexible
for people who use Infinispan this way. Listening to events to catch the .remove() event
cannot be easily added in a way that is both transaction safe (as enforced by Infinispan)
and will never ever leak data (as in, the accidental re-creation of the cache that belongs
to a now removed MyObject).
Enhance cache management methods on EmbeddedCacheManager
--------------------------------------------------------
Key: ISPN-905
URL:
https://issues.jboss.org/browse/ISPN-905
Project: Infinispan
Issue Type: Feature Request
Components: Core API
Affects Versions: 4.2.0.Final
Reporter: Patrick McFarland
Assignee: Galder Zamarreño
Fix For: 5.0.0.ALPHA3, 5.0.0.Final
These should include:
{code:borderStyle=solid}
boolean cacheExists(String cache)
Cache<?, ?> getCacheIfExists(String cache)
boolean remove(String Cache)
{code}
Original request:
{quote}
There seems to be no ability to check if a populated cache exists through both
CacheManager and through Cache (=is this still a valid handle) and to get a cache if it
exists.
{quote}
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira