]
Manik Surtani commented on JBCACHE-1359:
----------------------------------------
Thanks for this. Do you have a unit test that proves this? Preferably something that
concisely looks at nodes and the deleted flag ratehrt han a roundabout cache loader setup?
Also, do you know if this is a problem on 2.X as well?
Nodes are not removed during commit if new children have been added
to their parents
------------------------------------------------------------------------------------
Key: JBCACHE-1359
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1359
Project: JBoss Cache
Issue Type: Bug
Security Level: Public(Everyone can see)
Affects Versions: 1.4.1.SP9
Reporter: Kai Blankenhorn
Assigned To: Manik Surtani
Fix For: 1.4.X
Attachments: TreeCache_JBCACHE-1359.diff
Say we have a cache instance called "cache" that is configured to use a custom
CacheLoader that always returns "value from CacheLoader". Now we call:
cache.put("/a/b/c", "key", "cachedValue");
cache.remove(Fqn.ROOT);
cache.put("/a/B/c", "key", "cachedValue");
commitTx();
String val = (String) cache.get("/a/b/c", "key");
assertEquals("value from CacheLoader", val);
The result will be null instead of "value from CacheLoader".
The problem is that the parent nodes (for instance, "/a/b") are marked for
removal. In the same transaction after removing "/a/b", "/a" is
readded and thus unmarked. When the transaction is committed, "/a" is about to
be realRemove()d. But this method skips the node and its children, as it is no longer
marked for removal. This way "/a/b" is never removed and stays marked for
removal.
When reading "/a/b/c", the iteration over the fqn elements in
TreeCache.findInternal() skips all nodes marked for removal, never reaching the requested
node.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: