[jboss-user] [JBossCache] - Re: Manual eviction not working
mircea.markus
do-not-reply at jboss.com
Wed Feb 13 08:08:11 EST 2008
I've run the following test on 1.4.1SP3, works fine:
public void testIssues() throws Exception
| {
| TreeCache cache = new TreeCache();
| PropertyConfigurator conf = new PropertyConfigurator();
| conf.configure(cache, "..\\passivation-issues.xml");
| cache.startService();
| cache.put("/za_node", "key","value");
| cache.put("/za_node2", "key","value");
| cache.put("/za_node3", "key","value");
| cache.put("/za_node4", "key","value");
| cache.evict(Fqn.ROOT);
| assertEquals(0, cache.getNumberOfNodes());
| cache.stop();
|
| TreeCache cache2 = new TreeCache();
| PropertyConfigurator conf2 = new PropertyConfigurator();
| conf2.configure(cache2, "..\\passivation-issues.xml");
| cache2.startService();
| cache2.get("/za_node", "key");
| cache2.get("/za_node2", "key");
| cache2.get("/za_node3", "key");
| cache2.get("/za_node4", "key");
| assertEquals(4, cache2.getNumberOfNodes());
| cache2.stopService();
| }
I've used same config as one you posted.
Some comments on your code, though:
anonymous wrote : Fqn fqn = Fqn.fromString("/root/");
1. This will fetch you a node named 'root' (i.e. a child of root node), and not the root node which is '/'. Was this your intention?
2. You can evict all existing nodes this way: cache.evict(Fqn.ROOT);
If code was your issues hope this helps. Otherwise, Can you please create a UT (or change the one I've attached) to reproduce the issue, then a JIRA and attach code+config to it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129114#4129114
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129114
More information about the jboss-user
mailing list