0 Replies Latest reply on Apr 28, 2014 4:35 AM by coco mani

    lifespan set to -1 but entry got removed

    coco mani Newbie

      I've experienced a strange behavior with lifespan 6.0.2, in my XML configuration i've expiracy defined as follows:

      <expiration lifespan="1000" maxIdle="500" />
      

       

      which means lifespan is set to 1000ms. I tried to put data this way:

       

      cache.put(key, value, -1, TimeUnit.MICROSECONDS);
      

       

      however the entry is not available after this put (i.e. cache.get(key) returns null), I assume it was expired as when I change the TimeUnit to milliseconds every works fine!!

      Furthermore, when I define my configuration programatically I don't have this strange behavior. Here is my config

       

      new ConfigurationBuilder()
           .expiration().lifespan(10, TimeUnit.SECONDS).wakeUpInterval(100, TimeUnit.MILLISECONDS)
           .eviction().maxEntries(2000)
           .invocationBatching().enable().clustering()
           .cacheMode(CacheMode.LOCAL).transaction()
           .lockingMode(LockingMode.OPTIMISTIC)
           .transactionMode(TransactionMode.TRANSACTIONAL)
           .transactionManagerLookup(new GenericTransactionManagerLookup())
           .locking().isolationLevel(IsolationLevel.READ_COMMITTED)
           .jmxStatistics().disable()
           .build();
      

       

      any idea what's going on?