[jboss-user] [JBossCache] - replicating pojocache

noamg do-not-reply at jboss.com
Thu Sep 21 08:49:38 EDT 2006


Hello.
I am using PojoCache from release 1.4SP1
I am trying to have a map of aspectesized objects in a pojocache between two websphere 6 application servers. After some fiddling around, the tests run well from within the server, but now I bumped into a new problem -

In my setup, ServerA starts the application on the server, sees that it is the first computer on the cache, and initializes the map, filling it with objects.
ServerB starts the application later, and gets a pointer to the map form his own PojoCache, after it was replicated to it.
ClientA connects to ServerA asks for a portion of the map (he sends a small list of keys, and recieves a small sub-map of key->value pairs), and everything works fine. The value object has a "getTotal()" method, which returns the right number as it should.
ClientB connects to ServerB, with the exact same list of keys, and it recieves the same map. When I iterate over the recieved map IN THE SERVER, and just print out the "getTotal()" result, I get the right number. When I get back to the client, and do the same, all the totals are "0".

I think I have an idea as to why this is happening - in ServerA I change the objects in memory, which causes the total field to get updated both in memory, and in the cache. After the replication to ServerB, the in-memory objects contain only "0" in their fields, but each call to a method (like "getTotal()") gets transfered to the cache, and retrieves the right number. After sending it to the client, there is no connection with the cache, and the "getTotal()" just returns the in-memory value of "0".

Am I making sense here? Is there some way to tell the cache to fill up the in-memory objects as well in some way? Or do I have to take care of it myself?

I would much appreciate any tip on the matter, and thank you very much.

 Noam.

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

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



More information about the jboss-user mailing list