Package org.deuce.transaction

Examples of org.deuce.transaction.TransactionException


          try {
            Thread.sleep(BACKOFF);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
          throw new TransactionException();
        }
      }
      System.out.println("Old Enemy 1:" + metaData2[4]);
      context2.rollback();
      return 0;
    }
     
    Integer retries1 =(Integer)metaData1[1];
    if(retries1>MAX_RETRIES){
      System.out.println(metaData2[4] + " enemy of " + metaData1[4]);
      enemies1.add((Long)metaData2[4])// add context2 as enemy
      metaData1[1] = 0;
      try {
        Thread.sleep(BACKOFF);
      } catch (InterruptedException e) {
        e.printStackTrace();
      }
      throw new TransactionException();
    }
   
    if(metaData2[4].equals(metaData1[2]))
      metaData1[1] = ++retries1;
    else
View Full Code Here


              try {
                try {
              CommunicationManager.getManager().send(obj.getOwnerNode(), new ValidateRequest(obj.getId(), hashCode));
            } catch (IOException e) {
              e.printStackTrace();
              throw new TransactionException();
            }
            Logger.debug("READSET: Wait Remote " + obj + " Validation ...");
            wait();
            Logger.debug(obj + " [" + clock + " < " + (remoteValidateResult & LockTable.UNLOCK) + "]");
            if(clock<(remoteValidateResult & LockTable.UNLOCK)){
              Logger.debug("READSET: Remote Validation failed, remote version:" + (remoteValidateResult & LockTable.UNLOCK));
              throw new TransactionException();
            }
            Logger.debug("READSET: Remote Validation " + obj.getId() + " successeded.");
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
View Full Code Here

//            e.printStackTrace();
//          }
//        }
//        Logger.info("Done...");
        if(!(Boolean)metadata[VOTE_DECISION_INDEX])
          throw new TransactionException()// aborts
      }
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

 
  @Override
  public void beforeReadAccess(Object obj, long field) {
    // self-check validation
    if(isAborted())
      throw new TransactionException();
    // add to read-set
    if(obj instanceof AbstractLoggableObject){
      AbstractLoggableObject loggable = (AbstractLoggableObject)obj;
      while(!loggable.__isFree(getContextId())){
        Logger.debug(this + ":" + loggable.getId() + ":is not free : " + loggable.__getOwner());
View Full Code Here

  }
 
  public void beforeWriteAccess(Object obj, long field) {
    // self-check validation
    if(isAborted())
      throw new TransactionException();
    Logger.debug(this + ":Try access: " + obj);
    // add to write-set
    if(obj instanceof AbstractLoggableObject){
      AbstractLoggableObject loggable = (AbstractLoggableObject)obj;
      while(!loggable.__own(this)){  // try to set me as the owner
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

        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

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.