Hi Yaswanth,

Cache "puts" are asynchronous i.e. JCS sends data to the remote server
in a background thread. This will almost definitely cause the behaviour
(race condition) you're seeing.

Re: acknowledgements: someone else might answer that I'm not sure. My
hunch is that perhaps your use case isn't appropriate for a distributed
cache which does asynchronous puts. As a workaround your sender could
write your data to a database which is synchronous and also put it into
the cache. The receiver could then fetch it from the cache if available
or from the database if not. Though this use case could mean that you'll
have a low cache hit rate on this data due to the race condition you're
seeing.

Niall

On Thu, 2009-03-19 at 02:16 -0700, Yaswanth wrote:

> Hi , 
> 
> I have implemented Remote Cache with two clients and one Server. 
> 
> First Clients puts an Object into the Cache and sends the key over JMS to
> the second Client. Using which Second Client gets that Object from the
> Remote Cache . 
> 
> This entire thing is working for me on low loads .. When i load the system.
> I observed that Second Client retrieves few null messages from the remote
> cache..
> 
> My guess is that it would be only possible if the Second Client is trying to
> retrieve the Object even before the First Client puts into remote Cache.
> 
> Is there anything(something like acknowledgments) with which i can ensure in
> the Fist Client that i send the JMS Message  only after my object is kept in
> the remote cache.
> 
> Does a Remote Cache send back the acknowledgment to the clients when the
> Object is put into the cache ?
> 
> These are my Cache Config Files .. 
> http://www.nabble.com/file/p22595967/remote.cache.server.ccf
> remote.cache.server.ccf 
> http://www.nabble.com/file/p22595967/remote.cache.client.ccf
> remote.cache.client.ccf 
> 
> 
> Thanks
> Yaswanth

Reply via email to