[jboss-user] [JBossCache] - Re: Concurrency problem
manik.surtani@jboss.com
do-not-reply at jboss.com
Mon Jan 29 13:15:45 EST 2007
JBC does not acquite cluster-wide locks. These are only done when a tx is committing.
Try this:
|
| boolean doSomething()
| {
| int X = -1;
| while (X == -1)
| {
| try
| {
| X = getX();
| }
| catch (RollbackException e)
| {
| X = -1;
| }
| }
| return X;
| }
|
| int getX()
| {
| // start a new tx here.
| Integer X = (Integer) cache.get(fqn, key);
| X++;
| cache.put(fqn, key, X);
| // commit tx here.
| return X;
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007933#4007933
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007933
More information about the jboss-user
mailing list