Package org.deuce.transaction

Examples of org.deuce.transaction.TransactionException


        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here


        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here

        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here

   
    Long startTime1 = (Long)context1.contentionMetadata;
    Long startTime2 = (Long)context2.contentionMetadata;
   
    if(startTime1==null || startTime2!=null && startTime1 > startTime2)
      throw new TransactionException();
    else{
      if(context2 instanceof ControlContext)
        if(((ControlContext)context2).kill())
          return 0;
        else
View Full Code Here

      dist_conflicts++;
    else
      conflicts++;

    if(context1.status.equals(STATUS.ABORTED) || context2!=null && context2.status.equals(STATUS.BUSY))
      throw new TransactionException();
    if(context2==null || context2.status.equals(STATUS.ABORTED) || context2.equals(context1))
      return 0;
    return -1;
  }
View Full Code Here

          if(result>0)
            return result;
        }
        return result;
      } catch (Exception e) {
        throw new TransactionException();
      }
    }
  }
View Full Code Here

    Integer opendObjects1 = (Integer)context1.contentionMetadata;
    Integer opendObjects2 = (Integer)context2.contentionMetadata;
   
    Logger.debug(context1+":"+opendObjects1 + " vs " + context2+":"+opendObjects2);
    if(opendObjects1 < opendObjects2 || opendObjects1.equals(opendObjects2) && context1.getContextId() < context2.getContextId())
      throw new TransactionException();
    else{
      if(context2 instanceof ControlContext)
        if(((ControlContext)context2).kill())
          return 0;
        else
View Full Code Here

//      System.out.println(context1 + " sleeps " + backoff);
      return backoff;
    }
    else{
//      System.out.println(context1 + " aborted");
      throw new TransactionException();
    }
  }
View Full Code Here

  public int resolve(AbstractContext context1, AbstractContext context2) {
    if(super.resolve(context1, context2)==0)
      return 0;
   
    if(context1.getContextId() > context2.getContextId())
      throw new TransactionException();
    else{
      if(((Context)context2).rollback(false))
        return 0;
      return -1;
    }
View Full Code Here

      retries = 0;
    else
      retries++;
    context1.contentionMetadata = retries;
    if(retries>MAX_RETRIES){
      throw new TransactionException();
    }
    return (int)(Math.random()*((int)Math.pow(2, retries) * 10));
  }
 
View Full Code Here

TOP

Related Classes of org.deuce.transaction.TransactionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.