Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-8023

Cache Abstraction - Expired cache elements cause return value null instead of calling method

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Complete
    • Affects Version/s: 3.1 M1
    • Fix Version/s: 3.1 M2
    • Component/s: Core
    • Labels:
      None

      Description

      Using Caching Abstraction with EhCache. If a method result cache entry is expired from the backing cache due to having exceeded timeToLiveSeconds, cache abstraction returns a value of null rather than proceeding with the @Cacheable annotated method call.

      This may be related to SPR-8006.

      See the attached example, which is an Eclipse Helios project archive.

        Activity

        Hide
        costin Costin Leau added a comment -

        Issue has been fixed (the ehcache implementation was using isKeyInCache() which for some reason considers expired keys as well which are then evicted on get() calls). Can you please try the latest snapshot/trunk version?

        Thanks,

        Show
        costin Costin Leau added a comment - Issue has been fixed (the ehcache implementation was using isKeyInCache() which for some reason considers expired keys as well which are then evicted on get() calls). Can you please try the latest snapshot/trunk version? Thanks,
        Hide
        davecurryco Dave Curry added a comment -

        Retested with the snapshot and it works. Thanks for the responsiveness!

        Show
        davecurryco Dave Curry added a comment - Retested with the snapshot and it works. Thanks for the responsiveness!

          People

          • Assignee:
            costin Costin Leau
            Reporter:
            davecurryco Dave Curry
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              4 years, 21 weeks, 5 days ago