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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to