[JBossCache] - Re: uninitialized nodes
by manik.surtaniï¼ jboss.com
"genman" wrote :
| There really should be options you can set to override loading from the cache loader, or for ignoring the return values for Node.put(key, value) or Node.remove(key) .
|
Yes, but then you change the behaviour of put() and remove(), which IMO should not be controlled by an option. Perahps add a putQuietly() or removeQuietly() that have return types of void, although this clutters up the API which sucks.
"genman" wrote :
| It would be nice if there was a "disable()" method on Interceptor. Interceptor.invoke() might have been public/final and delegated to a protected abstract method ...
Well, unless disabling was conditional (i.e., disable for all get() calls) you may as well yank the interceptor out of the chain.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064788#4064788
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064788
18Â years, 12Â months
[JBossCache] - Re: uninitialized nodes
by manik.surtaniï¼ jboss.com
"aditsu" wrote :
| I didn't put(node, key, value), but put(fqn, map). And it didn't load it from the cacheloader, until I tried to "get" something.
|
That is a bug. (I've updated JBCACHE-1133)
This is now fixed in HEAD with an updated unit test, and now:
* put(Fqn, Key, Value) triggers a load (because of return values needed)
* put(Fqn, Map) does not trigger a load
* get(Fqn, Key) does not trigger a load if the key is in memory, even if dataLoaded is false.
The last case can happen when:
1) create a new node - put(fqn, key, value)
2) node is evicted
3) put more data in the node - put(fqn, map) - node not loaded so dataLoaded = false.
4) get(fqn, k2) - if k2 exists in memory due to the put in 3), node is still not loaded and dataLoaded is left at false.
See UnnecessaryLoadingTest in CVS for details.
"aditsu" wrote :
| It should also not write that data to the cacheloader (this is yet another issue, I used a workaround for that too). The ultimate goal is to do my own optimized preloading of data from a database.
|
This bit I don't understand. Even if you're doing a put(Fqn, Map) and you don't want to load data from the loader, I can't imagine why you wouldn't want the data written TO the cacheloader. Beats the fundamental purpose of a cache loader if this doesn't happen.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4064787#4064787
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4064787
18Â years, 12Â months