Announcement Announcement Module
Collapse
No announcement yet.
Caching synchronization And returned null values with @Cacheable Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Caching synchronization And returned null values with @Cacheable

    Hi,

    I would like to know if null value values returned from an annotated @Cacheable method are cached?
    Is there a way to enable or disable it? Sometimes we do want to cache it!

    Moreover, what happened if I have two parallel same calls (same parameters) to an annotated @Cacheable method?
    Would it be executed twice? What if this method is resource consuming? We clearly want the second call to wait for the cached result of the first call.
    In our implementation we have another boolean property on the @Cacheable method badly named "synchronize".

    This enables us to say if we want the second call to wait for the result of the first one.

    ex:

    @Cacheable(value="cacheName", synchronize="true")
    Map<String, List<String>> resourceOrTimeConsumingMethod(String key);

    Do we have the same level of configuration in Spring 3.1 ?
Working...
X