You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Patrick Johnsn (Jira)" <ji...@apache.org> on 2020/11/19 20:01:00 UTC

[jira] [Updated] (GEODE-8733) Local region holds onto data by reference

     [ https://issues.apache.org/jira/browse/GEODE-8733?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Johnsn updated GEODE-8733:
----------------------------------
    Issue Type: Bug  (was: Improvement)

> Local region holds onto data by reference
> -----------------------------------------
>
>                 Key: GEODE-8733
>                 URL: https://issues.apache.org/jira/browse/GEODE-8733
>             Project: Geode
>          Issue Type: Bug
>          Components: regions
>    Affects Versions: 1.13.0
>            Reporter: Patrick Johnsn
>            Priority: Major
>
> If the client region is configured as `CACHING_PROXY`, the data on the server and the data in the local region can become out of sync because the local region stores things by reference, for example, if you were to do:
>  
> {code:java}
> list.add(1);
> list.add(2);
> list.add(3);
> list.add(4);
> map.put(1, "a");
> map.put(2, "b");
> map.put(3, "c");
> map.put(4, "d");
> Class1 obj = new Class1(1, list, map);
> region.put(obj.id, obj);
> map.clear();
> list.clear();
> map.put(12, "This shouldn't be here");
> list.add(38);
> System.out.println(region.get(1).toString());{code}
>  
>  the values retrieved by region.get(1) would look like "Class1\{id=1, someList=[38], someMap={12=This shouldn't be here}}" even though that update was made AFTER the put.
>  
> If you queried the server, you'd get the expected values because you're going directly to the server instead of the local region.
>  
> This issue was originally reported against Spring Data Geode but is reproducible in plain Geode.
> Original ticket for context: https://jira.spring.io/browse/DATAGEODE-388



--
This message was sent by Atlassian Jira
(v8.3.4#803005)