• Post Reply Bookmark Topic Watch Topic
  • New Topic

ehcache returning same(lastest value) for any call  RSS feed

 
Kiran Gaddam
Ranch Hand
Posts: 35
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I have configured ehcache for my application.



But every time I hit the method with new parameter, the same(last accessed) value is been returned

could any one please help..

Thanks
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This method declaration looks alright, although the key-attribute isn't really needed.

And if you comment the @Cacheable annotation you get different values for different parameter values?
 
Kiran Gaddam
Ranch Hand
Posts: 35
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the response.
Anyway I solved it. The issue was the response object was autowired with "@autowired" annotation

something like..




Removed autowired annotation and declared with new instance. Works fine now.

Thankyou for the response
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to hear you solved your issue! Thanks for coming back and sharing your solution. That's a good practice, but not everyone adheres to it. Have a cow!

I have to admit the @Autowired annotation on the instance member and re-assigning this instance member with each call to the getCoreOnsiteStatistics method seemed a little bit odd to me.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!