zzsoszz / ehcache-spring-annotations

Automatically exported from code.google.com/p/ehcache-spring-annotations
0 stars 0 forks source link

copy on read doesn't seem to work properley. #62

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add a custom copy strategy
2. utilise method cache on a mutable object
3. mutate object & re-use

What is the expected output? What do you see instead?
I expected the copy strategy to allow a copy of the method return type to be 
returned.
It seems that the entry is copied, and put back into the cache, and then the 
valueObject is returned.
On further gets, the valueObject may have changed value.

What version of the product are you using? On what operating system?
eh cache - bundled, upgraded to 2.31, still didn't work correctly.
Java 6 environment - Win 7 and CentOS 5.5, both x64.

Please provide any additional information below.
Copy strategy has a 'generic' method signature, but always receives the 'cache 
entry' type.
Either an interface definition error, or a code error.
I suspect the latter, as it would be greatly beneficial it the method return 
object was directly copied.

Original issue reported on code.google.com by nicholas...@gmail.com on 25 Jan 2011 at 11:47

GoogleCodeExporter commented 9 years ago
... err.. sorry, think this is ehcache, not *-annotations.]
But stil, it would be a good annotation change to add.
--nK

Original comment by nicholas...@gmail.com on 25 Jan 2011 at 11:54

GoogleCodeExporter commented 9 years ago
The annotations project simply provides a short-hand to cache the results of a 
method call. Internal cache behavior like copy on write or copy on read is 
outside of the scope of this library.

Original comment by eric.dalquist on 25 Jan 2011 at 3:15