[jboss-user] [JBoss Cache: Core Edition] - ClusteredCacheLoader

lovelyliatroim do-not-reply at jboss.com
Fri May 16 09:54:48 EDT 2008


Hi Guys,
   Im seeing what i can only explain as strange behaviour using the ClusteredcacheLoader. Ok I´ll try and explain what im seeing. I have tried my code both with and without the ClusteredCacheLoader, everything works as expected when i dont have the cacheloader configured which leads me to believe it is something to do with my cache loader.

I have 2 nodes both running on tomcat (One actually runs on tomcat 5 and other tomcat 6 (dont ask)) 

As i said, without ClusteredcacheLoader, everything works fine.

Ok, I´ll try and explain, Node 1 and Node 2 are empty. Node 1 receives a request for data item X.  Request for data Item X triggers 2 calls and 2 entries to be put into the cache. The path for data item 1 looks like so

/a/b(2)

Entry into the cache for data item 2 looks like so
/b/c/d/e(2)

*(2) This is the no of elements in the hashmap of the node. 1 is the custom object that i want to store and the other the expiration element needed for the expiration policy.

Im using the expiration eviction policy, the timeout for the first daa item is 15 mins and the 2nd is a week.

Now heres what happens.

I make the first request for data item X, its not there so i put 2 entries into the cache. What i expect to see is this
/a/b(2)
/b/c/d/e(2)

I look at my custom made mbean to view the cache tree and i see entries like so
/a(0)
/b(0)

I make a 2nd request, still within time frame and i see the following
/a/b(2)
/b/c(0)

I now have an entry in the cache for the first data element but still not the 2nd.

I make a third request and i see
/a/b(2)
/b/c/d(0)

I get a hit for the first data element but still not the 2nd.

And finally i make the 4th request and afterwards i see
/a/b(2)
/b/c/d/e(2)

So finally after 4 requests the same data item gets put into the cache. It looks like with every time i make a request it stores the extra path element. i.e
1st request /b
2nd /b/C
3rd /b/c/d
4th /b/c/d/e

Any ideas as to whats going on, the nodes have the same config, i havent changed "ClusterConfig" for the 2 nodes, should i?? Maybe port changes??(I need to read up on the jgroups side of things).

On another note, is there anything like jmx-console that runs in tomcat?? So i can use the jmx-beans that come out of the box with jboss-core, i mean more in relation to the tree structure, JConsole doesnt give me the nice tree structure that i would get when using jmx-console.

Like i said earlier, it works as i expect without the CacheLoader configured. I´m running the cache in REPL_ASYNC with a bit of hack like so
anonymous wrote : 
  | 	treeCache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
  | 
for every item added to the cache to stop them from been replicated to other nodes. Also its the 2.1 version im using.

Thanks,
LL

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

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




More information about the jboss-user mailing list