-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
4.2.0.CR3
-
None
It would be advantageous if the beheaviour of the delivered modify events did not deliver null values after a put which is different from a put which replaces which does deliver the actual value. It is also not possible to take the key from the create event and try and read the cache. I have tried printing both when the Event.isPre() field is false and true and the value is null.
Please examine the provided test harness which includes some prints the output which demonstrates the problem...
—
package miroslav.pokorny.cache.infinispan;
import org.infinispan.manager.DefaultCacheManager;
import org.infinispan.manager.EmbeddedCacheManager;
import org.infinispan.notifications.Listener;
import org.infinispan.notifications.cachelistener.annotation.CacheEntryCreated;
import org.infinispan.notifications.cachelistener.annotation.CacheEntryModified;
import org.infinispan.notifications.cachelistener.event.CacheEntryCreatedEvent;
import org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent;
public class InfinispanValueProblemTest {
private final static String KEY = "key";
private final static String VALUE = "Value";
static public void main(final String[] ignored)
{ final EmbeddedCacheManager manager = new DefaultCacheManager(); final org.infinispan.Cache<String, String> cache = manager.getCache(); cache.addListener(new InfinispanCacheListener()); cache.put(KEY, VALUE); } @Listener
static final public class InfinispanCacheListener {
@CacheEntryCreated
public void entryCreated(final CacheEntryCreatedEvent<String, String> event)
@CacheEntryModified
public void entryModified(final CacheEntryModifiedEvent<String, String> event)
}
}
-------------------------------------------
Running the test should print something like this
[ GlobalComponentRegistry] - Infinispan version: Infinispan 'Ursus' 4.2.0.CR3
[ ComponentRegistry] - Infinispan version: Infinispan 'Ursus' 4.2.0.CR3
CREATE EVENT
key= cant do get value
isPre=true
event.getCache().get(event.getKey())=null
CREATE EVENT
key= cant do get value
isPre=false
event.getCache().get(event.getKey())=null
MODIFIED EVENT
key=null
isPre=true
event.getCache().get(event.getKey())=null
MODIFIED EVENT
key=Value
isPre=false
event.getCache().get(event.getKey())=null
- relates to
-
ISPN-2766 Improve and adapt notification model to fit JSR107 notification model
- Closed