Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
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.
Attachments
Issue Links
- duplicates
-
JCS-73 concurrent cache access causes values loss
- Closed