gchm2010 / simple-spring-memcached

Automatically exported from code.google.com/p/simple-spring-memcached
MIT License
0 stars 0 forks source link

Using @ReturnValueKeyProvider for an @UpdateSingleCache annotated method does not generate key properly #15

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Using @ReturnValueKeyProvider for an @UpdateSingleCache annotated method 
having other parameters.
2. The cache key generation fails with exception InvalidParameterException("Ids 
for objects in the cache must be at least 1 character long.")
3. Updates nothing in the cache as key generation failed.

What is the expected output? What do you see instead?
Should generate key for the Object annotated by @ReturnValueKeyProvider and 
accept @CacheKeyMethod as key method inside return object.

What version of the product are you using? On what operating system?
version 3.1.0

Please provide any additional information below.
As @ReturnValueKeyProvider is provided it should not always expect 
@ParameterValueKeyProvider and proceed key generation using the return object. 
It restricts users to provide mandatory ParameterValueKeyProvider which is not 
always desired.

It is a logical bug, in CacheKeyBuilderImpl and/or AnnotationDataBuilder.
the later sets returnKeyIndex as true and do not process any 
ParameterValueKeyProvider, but cache key generator expects a parameter key.

I fixed this issue.., let me know if I need to update code for verification.

Original issue reported on code.google.com by amitava....@gmail.com on 26 Mar 2013 at 4:06

GoogleCodeExporter commented 8 years ago
Thank you for the report. 
I confirm that there is a bug. Proper junit test that detect the bug is ready. 
Fix will be available in several minutes on trunk.
Could you please build SSM from trunk (or download snapshot version) and test 
if it works in your case?

Original comment by ragno...@gmail.com on 26 Mar 2013 at 7:47

GoogleCodeExporter commented 8 years ago

Original comment by ragno...@gmail.com on 26 Mar 2013 at 7:47

GoogleCodeExporter commented 8 years ago
Fix in trunk

Original comment by ragno...@gmail.com on 26 Mar 2013 at 8:24

GoogleCodeExporter commented 8 years ago

Original comment by ragno...@gmail.com on 24 Jun 2013 at 8:26

GoogleCodeExporter commented 8 years ago
Included in release 3.2.0

Original comment by ragno...@gmail.com on 27 Jun 2013 at 7:57