2 Replies Latest reply: Oct 13, 2008 5:15 AM by Manik Surtani RSS

JBCACHE-1423 Fix

Brian Stansberry Master

Discussion of https://jira.jboss.org/jira/browse/JBCACHE-1423 -- see JIRA description for background.

The "simple fix" I discuss on the JIRA solves the out-of-date state problem, but breaks a number of other unit tests:

o.j.c.loader.UnnecessaryLoadingTest.testDontLoadWhenKeyInMemory()
o.j.c.loader.UnnecessaryLoadingTest.testUnnecessaryMultipleLoading()
o.j.c.mgmt.CacheLoaderTest.testCacheLoaderMgmt()
o.j.c.mgmt.PassivationTest.testPassivationMgmt()

In the first two there are specific assertions that a put(Fqn, Map) call doesn't result in a cache loader load. The latter two fail because the test setup does a bunch of put(Fqn, Map) calls and the tests assert that this didn't result in any cache loader misses; w/ my fix it does.

Bottom line, my simple fix results in cache loader get() calls that weren't there before. So, hopefully you guys have a better solution. ;) One possibility is what I mentioned on the JIRA -- change CLI.loadNode so it doesn't overwrite existing in-memory key/value pairs with those from the persistent store.

I'll check in the unit test for this.