I was able to get this working with this code:
CacheSPI cacheSpi = (CacheSPI) cache;
CacheStoreInterceptor csi = null;
int index = 0;
for (Object o : cacheSpi.getInterceptorChain())
{
if (o instanceof CacheStoreInterceptor)
{
csi = (CacheStoreInterceptor) o;
break;
}
index++;
}
cacheSpi.removeInterceptor(CacheStoreInterceptor.class);
rootNode.removeChild("mostlyStaticDataNode");
cacheSpi.addInterceptor(csi, index);
rootNode.getChild("mostlyStaticDataNode");
Basically, I remove the cache store interceptor before removing the child (this
removes the local node but doesn't touch the database). I then add the
interceptor back and retrieve the node. This will "refresh" the node from the
database.
Of course, there are a couple problems with this code. The first is that I'm
casting Cache to CacheSPI which I know is not recommended. The second is that
it's pretty much a hack. Is there a more elegant way to accomplish this?
Dustin
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4238644#4238644
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4238644
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user