Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-5801

Cache with CacheLoader and CreatedExpiryPolicy Invalidates Instantly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.1.0.Alpha2, 8.1.0.Final
    • 8.0.1.Final
    • JCache
    • None
    • Hide

      Create a simple read-through cache using a CacheLoader and CreatedExpiryPolicy will never return the loaded value.

      Show
      Create a simple read-through cache using a CacheLoader and CreatedExpiryPolicy will never return the loaded value.

    Description

      When using a javax.cache.expiry.CreatedExpiryPolicy and a javax.cache.integration.CacheLoader the value generated for the org.infinispan.jcache.embedded/JCacheInternalMetadata#expiry is not relative to TimeService#wallClockTime. It therefore invalidates the entry instantly.

      I believe the problem is in org.infinispan.jcache.embedded.JCacheLoaderAdapter[line=48] where org.infinispan.jcache.Expiration#getExpiry(...) doesn't calculate the relative value so org.infinispan.jcache.embedded.JCacheInternalMetadata#isExpired always returns true.

      Unfortunately, work doesn't allow me to upload code so I can't submit an example.

      Attachments

        Activity

          People

            rh-ee-galder Galder ZamarreƱo
            dansiviter Daniel Siviter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: