Post

2 followers Follow
0
Avatar

Region get return a object copy?

Hi,

I'm developing an api rest application that use a gemfire client to store data. In a controller of this application I do a get of a region, and that I'm watching is that the object is copy to the original object, if I modified the object the changes are not saved on the region at least that I do the put.

I need to change this behavior, and that the region return the original object not a copy.

Juan Manuel Romera Ferrio

Please sign in to leave a comment.

2 comments

0
Avatar
The changes you make to the object will not be propagated to the server until you do a put() operation. So, to avoid future debugging problems, I would suggest that you always do a put().

Having said that, to disable copy-on-read in your cache.xml you can define your cache like so:
<client-cache copy-on-read="false">

or using the API:
ClientCacheFactory cf = new ClientCacheFactory();
ClientCache cache = cf.create();
cache.setCopyOnRead(false);
 
Swapnil Bawaskar 0 votes