[ 
https://issues.apache.org/jira/browse/CAY-2748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17564556#comment-17564556
 ] 

Andrus Adamchik commented on CAY-2748:
--------------------------------------

I am +1 on the idea to make cached lists immutable. Making a mutable copy every 
time you retrieve something from the cache is just wrong. Wrapping the list in 
an immutable list is probably the way to go. 

> Mutating the list returned from the local query cache changes the cache
> -----------------------------------------------------------------------
>
>                 Key: CAY-2748
>                 URL: https://issues.apache.org/jira/browse/CAY-2748
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.1.1, 4.2.RC1, 4.3.M1
>            Reporter: John Huss
>            Assignee: John Huss
>            Priority: Minor
>             Fix For: 4.3.M1
>
>   Original Estimate: 4h
>          Time Spent: 10m
>  Remaining Estimate: 3h 50m
>
> If you perform a query that populates the local query cache and then mutate 
> the returned list (by adding an object), this mutation will persist inside 
> the local query cache so that subsequent queries that hit the local query 
> cache will incorrectly include this mutation. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to