Here's the thing. Machine 1 might store 10, but then if you call Machine 2, it might
store 0. What you need to do is more like:
| Integer count = (Integer)cache.get("/a/b/c", "Key1");
| if (count == null) // initialize
| count = 0;
| count = count + 1;
| cache.put("/a/b/c", "Key1", count);
|
But there's a potential race condition here. Use pessimistic locking and transactions
to ensure this is atomic.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132286#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...