• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring ehcache null value caching

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I do not want null values to be cached. by default ehcache caches even null values. I am using spring gooogle ehcache annotations.
I could not find in any documentation on how I can configure to say "do not cache null values"

any help is greatly appreciated.

Thanks
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saritha Penumudi wrote:Hi,

I do not want null values to be cached. by default ehcache caches even null values. I am using spring gooogle ehcache annotations.
I could not find in any documentation on how I can configure to say "do not cache null values"

any help is greatly appreciated.

Thanks



This is unrelated to Spring. You have to look at the ehcache documentation. Although, I was never away of null values in the cache. What are null?

Mark
 
Saritha Penumudi
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response. I did find any another place to post my question. I figured as I am using spring google code ehcache annotations, there could be some configuration in spring-ehcache configuration where I can say "do not cache null values".

I found the solution. There is an attribute in @cacheable called cachenull. When set to false it will not cache null values. Found solution from issues list of the googlecode spring ehcache project.
 
Mark Spritzler
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Saritha Penumudi wrote:Thanks for the response. I did find any another place to post my question. I figured as I am using spring google code ehcache annotations, there could be some configuration in spring-ehcache configuration where I can say "do not cache null values".

I found the solution. There is an attribute in @cacheable called cachenull. When set to false it will not cache null values. Found solution from issues list of the googlecode spring ehcache project.



Good job.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic