You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jakarta.apache.org by "Alexander Sofronov (JIRA)" <ji...@apache.org> on 2010/04/22 12:51:50 UTC

[jira] Created: (JCS-74) Some data may be lost when adding/removing entries with the same key

Some data may be lost when adding/removing entries with the same key
--------------------------------------------------------------------

                 Key: JCS-74
                 URL: https://issues.apache.org/jira/browse/JCS-74
             Project: JCS
          Issue Type: Bug
          Components: Indexed Disk Cache
            Reporter: Alexander Sofronov
            Assignee: Aaron Smuts


I see this problem in jcs-1.3.3.5-RC.jar.

When adding/removing data to IndexedDiskCache some data may be lost.

Consider the following sample:

cache.put("key", "value1");
cache.put("key", "value2");
cache.put("key", "value3");

After running this code the cache often stores only "value1", other values may be lost. It looks like this is caused by asynchronous cache update mechanism, adding some pause (say Thread.sleep(100)) between different puts fixes the problem.

Also (it may be another bug actually) it could happen that the following code will not write any data to the cache:

cache.put("key", "value1");
cache.remove("key");
cache.put("key", "value2");

This happens non-deterministically on my machine, in case of problems with reproducing this try put some other data before this test to make the queue longer.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.