Spring Framework
  1. Spring Framework
  2. SPR-8023

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker 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 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 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
        Dave Curry added a comment -

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

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

          People

          • Assignee:
            Costin Leau
            Reporter:
            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:
              3 years, 7 weeks, 2 days ago