Package org.deuce.transaction

Examples of org.deuce.transaction.Context


  }


  public static void deleteCustomer(String customerId) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        deleteCustomer(customerId, context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return;
          }
        }
      } else {
        if(context instanceof ControlContext)
          ControlContext.abort(((ControlContext)context).getContextId());
        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here


 
 
 
  public static void updateOffers(boolean[] opType, String[] objId, int[] price) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        updateOffers(opType, objId, price, context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return;
          }
        }
      } else {
        if(context instanceof ControlContext)
          ControlContext.abort(((ControlContext)context).getContextId());
        else
          context.rollback();
        commit = true;
      }
    }
    throw new TransactionException("Failed to commit the transaction in the defined retries.");
  }
View Full Code Here

TOP

Related Classes of org.deuce.transaction.Context

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.