• Bug
  • Status: Closed
  • Resolution: Fixed
  • drb
  • Reporter: sourceforgetracker
  • September 21, 2009
  • 0
  • Watchers: 0
  • September 22, 2009
  • September 22, 2009

Description

I have a webapp where I’m using ehcache for some simple caching needs. I have a cache configured to persist to the diskStore (see config file below).

The elements I’m putting in the cache are not showing up in either the memory store or the disk store, so I added some debug messages to the put method of the MemoryStore class:

public final synchronized void put(Element element) throws CacheException { if (element != null) { LOG.debug(“adding [” + element.getObjectKey() + “] to memoryStore. Element will expire in [” + element.getTimeToLive() + “] seconds.”);

    map.put(element.getObjectKey(), element);
        
    LOG.debug("internal map contains key? [" + map.containsKey(element.getObjectKey()) + "]");

    doPut(element);
} \}

My first debug message prints, so it should be adding the element, but the second debug message prints “false”.

If I change my timeToLiveSeconds to a lower value (e.g. I was previously using 604800), the element is stored in cache like it should be.

I wrote up a JUnit test to reproduce the bug, so please see the attached file. Sourceforge Ticket ID: 1606323 - Opened By: jabbathegriffin - 30 Nov 2006 20:05 UTC

Comments

Fiona OShea 2009-09-22

Re-opening so that I can properly close out these issues and have correct Resolution status in Jira