سؤال

Client Cache Configuration -

<region name="test" refid="PROXY">
    <region-attributes>
        <cache-listener>
            <class-name>com.test.cache.SimpleCacheListener</class-name>
        </cache-listener>
    </region-attributes>
</region>

For the above client side configuration , I have used a CacheListener which listens to events on this cache "test".

The issue that i am facing is even on update event , i.e putting a different value for same key in cache , an afterCreate Event is fired.

i.e.

region.put("test key","test value")

and

region.put("test key","test updated value")

both generate an afterCreateEvent in Listener.

EDITED

Let me be little bit more clear on what i want to achieve here.I want my client side to be notified while making an entry that whether that entry is already there in the Cache Server or not.

for e.g.

If Entry [Test,Value] already exists on Cache Server for a region, then while making a put [Test,Value1] client should know that this is an update and this should be done irrespective of that entry being there in client cache or not.

I tried something like this-

<region name="test" refid="PROXY" >
        <region-attributes data-policy="normal">
        <!--  <region-attributes> -->
        <subscription-attributes interest-policy="all"/>
            <cache-listener>
                <class-name>com.cache.test.SimpleCacheListener</class-name>
            </cache-listener>
        </region-attributes>

    </region>

After making above changes, it detects the update events but only if the same client just made an entry and try updating it and not for earlier created entries.

Please help and let me know if i am missing something.

هل كانت مفيدة؟

المحلول

I just answered your question on the VMware discussion forum for GemFire:

http://communities.vmware.com/thread/424682?tstart=0

نصائح أخرى

If the key is being modified on a different cache and it was not present in your client proxy cache, then yes, it's a creation event.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top