-
1. Re: How does
belaban Apr 21, 2005 3:41 AM (in response to roginsky)I suggest you
(a) look at the FileCacheLoaderTest for examples and
(b) update to 1.2.2 -
2. Re: How does
roginsky Apr 21, 2005 11:44 AM (in response to roginsky)Thank you Bela!
I tried running the testEvictionWithCacheLoader2 from the CacheLoaderTestBase class, and it indeed works. Then I modified it like this (because this is the functionality I'm looking for):
cache.putObject("/first/second/third", "val1"); // stored in cache loader
cache.evict(Fqn.fromString("/first/second/third")); // removes node, because there are no children
assertFalse(cache.exists("/first/second/third"));
assertTrue(cache.exists("/first/second"));
assertTrue(cache.exists("/first"));
String val=(String)cache.getObject("/first/second/third"); // should be loaded from cache loader
assertEquals("val1", val);
assertTrue(cache.exists("/first/second/third"));
assertTrue(cache.exists("/first/second"));
assertTrue(cache.exists("/first"));
getObject returns null, so bolded assertEquals fails. Am I not understanding how the Aop tree works with objects? I tried adding cache.load("/first/second/third") just before cache.getObject(), and it didn't help.
Also, when I downloaded 1.2.2 zip file, the jboss-jmx.jar wass missing org.jboss.mx.util.JBossNotificationBroadcasterSupport class, so I had to get this jar from CVS. -
3. Re: How does
roginsky Apr 21, 2005 7:56 PM (in response to roginsky)P.S. It appears that for the TreeCacheAop evict() causes complete removal of the node from the backstore. The regular TreeCache doesn't do it. Is this the expected behavior? I though eviction only affects the memory cache, but not the backstore. Is there any configuration that would prevent it from happening?
P.P.S. If I use exactly the same Aop cache and configuration, but instead of using putObject(fqn, pojp) API, use put(fqn, key, pojo), the backstore node doesn't get removed during "evict()" call.
Thank you for your help and for getting back to me so quickly after my first post. -
4. Re: How does eviction work for Aop tree
roginsky Apr 22, 2005 11:14 AM (in response to roginsky)I hope someone is reading it... or am I writing to myself?
Anyway, I think this is the problem code (from TreeCacheAop.java):
public void evict(Fqn fqn) throws CacheException {
// We will remove all children nodes as well since we assume all children nodes are part
// of this "object" node.
if(isAopNode(fqn)) {
if(log.isDebugEnabled()) {
log.debug("evict(): evicting whole aop node " +fqn);
}
// _remove(null, fqn, create_undo_ops, false);
// TODO Why do we not want to remove the interceptor??? I think we should.
// Because if we remove it, the caller has no idea that it has been taken off.
// She will still think that caching is in effect. But this returns null value from cache.
// What's is a good policy?
boolean removeCacheInterceptor = false;
_removeObject(fqn, removeCacheInterceptor); } else {
super.evict(fqn);
}
}
Is it possible to remove the interceptor only for this one call (_removeObject) and then put it back? Seems like that would be the right thing to do. -
5. Re: How does
ben.wang Apr 22, 2005 11:39 AM (in response to roginsky)Yes, we are reading. :-)
This looks like a bug. Can you open up a Jira issue under JBossCache and please assign it to me.
Thanks,
-Ben -
6. Re: How does
roginsky Apr 22, 2005 12:12 PM (in response to roginsky)Oh, thank you, thank you,thank you!
You guys are awesome, responding so quickly to so many people (not to mention your great products and impressive documentation)! I only wondered whether anyone was reading because I had no idea how you managed it.
I opened an issue, but I don't have the authority to assign it.
http://jira.jboss.com/jira/browse/JBCACHE-135
Thanks again! -
7. Re: How does
mohamedj Jun 30, 2005 11:40 AM (in response to roginsky)Is there any idea when this will be fixed?
-
8. Re: How does
ben.wang Jun 30, 2005 6:55 PM (in response to roginsky)Probably within next two weeks.
-Ben -
9. Re: How does
mohamedj Jul 5, 2005 12:13 PM (in response to roginsky)Great news! Is there a scheduled build release coming soon after?
-
10. Re: How does
ben.wang Jul 5, 2005 12:42 PM (in response to roginsky)Release 1.2.4 is scheduled at the end of August for now. But you are welcome to try out the development version once I get it fixed.
Stay tune,
-Ben -
11. Re: How does
ben.wang Jul 5, 2005 9:01 PM (in response to roginsky)OK, I have checked in the code. You can grab the cvs and build for yourself if you want. I have added a new test case FileCacheLoaderAopTest to test it out.
Release 1.2.4 is scheduled for end of August now.
-Ben