[jboss-user] [JBossCache] - Node locking question

darose do-not-reply at jboss.com
Fri Apr 20 13:11:06 EDT 2007


Hi.  I'm kicking the tires on integrating JBossCache (2.0beta) into an app of mine.  So far looks pretty good, but I've run into one small snag.

I would like to find a way to atomically replace the contents of a node - i.e., perform:

node.clearData()

followed by

node.putAll(map)

all while the node is being locked.

In other words, a method something like:

node.setData(map)

if it existed.


>From what I can glean from the (somewhat minimal) details in the docs about locking, it looks like the putAll method operates under a lock, which is somewhat helpful.  But the problem with using that is that if the old map contained mappings that don't exist in the new one, the old mappings will still remain in the node's data.

So what I'm looking for is a way to replace the node's entire data.  Any thread-safe way to do that?

TIA,

DR

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

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



More information about the jboss-user mailing list