Given that you are effectively changing the key, i.e. removing one entry and inserting another, I don't think there is a way in Coherence to do this transactionally (I know there is a transactional cache but we don't want to go there unless you are not doing anything much with the cache). When you think about it, the old entry and new entry might be located on different JVMs on different physical boxes and there is no link between them. How ever you do the update there will be a window of time where you might see the line item in both the old and new orders or in neither order, before it is finally correctly in the new order only. It depends how important it is that this window exists and whether any of your application code may break because of it, this of course depends on how your code accesses the line items.
Thanks for getting back.
Currently have 3 distributed caches on same service with data affinity. Its possible that I need update key's in all 3 caches. So making all 3 caches as transactional cache might not fly as these are the 3 main caches in my cluster.
I guess.. I have to live with the fact that there is window when I might see the line item in both old and new orders or in neither orders. Whats efficient/optimal way to update orderId in LineItem, so that window is as small as possible.