Package org.deuce.transaction

Examples of org.deuce.transaction.Context


  }


  public void add(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        add(value, 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 boolean delete(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    boolean result = false;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        result = delete(value, context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return result;
          }
        }
      } 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 boolean find(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    boolean result = false;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        result = find(value, context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return result;
          }
        }
      } 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 int sum() throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    int result = 0;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        result = sum(context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return result;
          }
        }
      } 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

    new Node(HEAD, -1)// create the head node
  }

  public void add(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        add(value, 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 boolean delete(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    boolean result = false;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        result = delete(value, context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return result;
          }
        }
      } 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 void add(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        add(value, 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 boolean find(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    boolean result = false;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        result = find(value, context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return result;
          }
        }
      } 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 boolean delete(Integer value) throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    boolean result = false;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        result = delete(value, context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return result;
          }
        }
      } 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 int sum() throws Throwable{
    Throwable throwable = null;
    Context context = ContextDelegator.getInstance();
    boolean commit = true;
    int result = 0;
    for (int i = 0; i < 0x7fffffff; i++) {
      context.init(3);
      try {
        result = sum(context);
      } catch (TransactionException ex) {
        commit = false;
      } catch (Throwable ex) {
        throwable = ex;
      }
      if (commit) {
        if (context.commit()) {
          if (throwable != null) {
            throw throwable;
          } else {
            return result;
          }
        }
      } 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.