[jboss-user] [JBossCache] - Node clear method bug or problem in my way to use it.

pitoui do-not-reply at jboss.com
Thu Dec 14 10:17:59 EST 2006


Hi,

We are currenlty evaluating jbosscache and performing some initial tests to see if all required functionality reacts well.
the problem I found is when you "clear" a Node. the behavior of put is not good. it still return an "old Object" instead of returning null as get is doing

please see below the sample code to reproduce the problem

TreeCache _treeCache = new TreeCache();
		
PropertyConfigurator config = new PropertyConfigurator(); 	    config.configure(	    		_treeCache,"./testfiles/jbosscache/treecache.xml" 
	    );
		
_treeCache.createService(); // kick start tree cache
_treeCache.startService(); // kick start tree cache


Object ret = _treeCache.put("a/b","key","testString"); //ret it null as expected
	    
	    
ret = _treeCache.get("a/b","key"); // ret is not null as expected
   
_treeCache.get("a/b").clear(); // we clear the cache

ret = _treeCache.get("a/b","key"); //ret it null as expected
        
// HERE IS THE PROB
ret = _treeCache.put("a/b","key","anotherstring"); //ret is not null but equals to testString 
	    
_treeCache.stopService();

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993886#3993886

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993886



More information about the jboss-user mailing list