Examples of TransactionStatus


Examples of com.oltpbenchmark.types.TransactionStatus

   *
   * @param llr
   */
  protected final TransactionType doWork(boolean measure, Phase phase) {
      TransactionType next = null;
      TransactionStatus status = TransactionStatus.RETRY;
      Savepoint savepoint = null;
      final DatabaseType dbType = wrkld.getDBType();
      final boolean recordAbortMessages = wrkld.getRecordAbortMessages();
     
      try {
View Full Code Here

Examples of com.persistit.TransactionStatus

        long commitTimestamp = tsv;
        /*
         * There were members on at least one of the lists so we need to try to
         * find the corresponding TransactionStatus identified by tsv.
         */
        TransactionStatus status = getStatus(tsv);
        /*
         * The result can be null in the event the TransactionStatus was freed.
         * It could only have been freed if its transaction committed at a tc
         * that is now primordial. Therefore if status is null we can return tsv
         * as the imputed tc value.
         */
        if (status != null) {
            /*
             * Found the TransactionStatus identified by tsv, but by the time we
             * we read its tc, that TransactionStatus may already be committed
             * to a new transaction with a different ts. Therefore we briefly to
             * lock it to get an accurate reading.
             *
             * If the TransactionStatus was concurrently freed and reallocated
             * to a different transaction, then it must have committed before
             * the floor timestamp.
             */
            long tc = status.getTc();
            while (status.getTs() == tsv) {
                if (tc >= ts) {
                    return UNCOMMITTED;
                }
                if (tc >= 0) {
                    return tc;
                }
                if (tc == ABORTED) {
                    return tc;
                }
                /*
                 * Waiting for status to resolve. To do this, lock, unlock and
                 * then retry.
                 */
                if (status.wwLock(SHORT_TIMEOUT)) {
                    tc = status.getTc();
                    status.wwUnlock();
                }
            }
        }
        return commitTimestamp;
    }
View Full Code Here

Examples of li.earth.urchin.twic.tx.TransactionStatus

    }
  }
 
  private void endTransaction(boolean success, String requestURI) throws ServletException {
    try {
      TransactionStatus status = TransactionStatus.byCode(tx.getStatus());
      if (success && status.isCommittable()) {
        logger.debug("committing transaction for {}", requestURI);
        tx.commit();
      }
      else if (status.isRollbackable()) {
        logger.debug("rolling back {} transaction for {}", status.getAdjective(), requestURI);
        tx.rollback();
      }
      else {
        logger.warn("unable to either commit or roll back {} transaction for {}", status.getAdjective(), requestURI);
      }
    }
    catch (Exception e) {
      String message = "exception ending transaction for " + requestURI;
      logger.warn(message, e);
View Full Code Here

Examples of net.hasor.db.transaction.TransactionStatus

    //
    //
    public void executeTransactional() throws Exception {
        /*T2-Begin*/
        System.out.println("begin T2!");
        TransactionStatus tranStatus = begin(Propagation.SUPPORTS);
        Thread.sleep(1000);
        {
            String insertUser = "insert into TB_User values(?,'安妮.贝隆','belon','123','belon@hasor.net','2011-06-08 20:08:08');";
            System.out.println("insert new User ‘安妮.贝隆’...");
            this.getJdbcTemplate().update(insertUser, newID());//执行插入语句
View Full Code Here

Examples of org.springframework.transaction.TransactionStatus

   */
  private static void executeLogicInNewTransaction(ActivityElement activityXml, ActivityInst activityInst, IAction action) {
    PlatformTransactionManager txManager = ApplicationContextHolder.getBean(PlatformTransactionManager.class);
    DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    TransactionStatus status = txManager.getTransaction(definition);
    try {
      action.execute(activityXml, activityInst);
      txManager.commit(status);
    } catch (Exception e) {
      txManager.rollback(status);
View Full Code Here

Examples of org.springframework.transaction.TransactionStatus

  private static void executeLogicInNewTransaction(ProcessDefine processDefine,
      ProcessInstance processInstance, IAction action) {
    PlatformTransactionManager txManager = ApplicationContextHolder.getBean(PlatformTransactionManager.class);
    DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
    definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
    TransactionStatus status = txManager.getTransaction(definition);
    try {
      action.execute(processDefine, processInstance);
      txManager.commit(status);
    } catch (Exception e) {
      txManager.rollback(status);
View Full Code Here

Examples of org.springframework.transaction.TransactionStatus

  @Override
  public TransactionStatus begin() {
    if(transactionManager != null) {
      DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
      TransactionStatus txStatus = transactionManager.getTransaction(definition);
      return txStatus;
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.springframework.transaction.TransactionStatus

  @Override
  public TransactionStatus begin(int propagationBehavior) {
    if(transactionManager != null) {
      DefaultTransactionDefinition definition = new DefaultTransactionDefinition();
      definition.setPropagationBehavior(propagationBehavior);
      TransactionStatus txStatus = transactionManager.getTransaction(definition);
      return txStatus;
    } else {
      return null;
    }
  }
View Full Code Here

Examples of org.springframework.transaction.TransactionStatus

    this.transactedPolicy = transactedPolicy;
  }

  public <T> T execute(TransactionCallback<T> action)
      throws TransactionException {
    TransactionStatus status = transactedPolicy.begin();
    T result = null;
    try {
      result = action.doInTransaction(status);
    } catch (RuntimeException ex) {
      transactedPolicy.rollbackOnException(status, ex);
View Full Code Here

Examples of org.springframework.transaction.TransactionStatus

    return result;
  }
 
  public <T> T execute(int propagationBehavior, TransactionCallback<T> action)
      throws TransactionException {
    TransactionStatus status = transactedPolicy.begin(propagationBehavior);
    T result = null;
    try {
      result = action.doInTransaction(status);
    } catch (RuntimeException ex) {
      transactedPolicy.rollbackOnException(status, ex);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.