Package org.springframework.transaction

Examples of org.springframework.transaction.PlatformTransactionManager.rollback()


    TransactionStatus status = txManager.getTransaction(definition);
    try {
      action.execute(activityXml, activityInst);
      txManager.commit(status);
    } catch (Exception e) {
      txManager.rollback(status);
      throw new ProcessEngineException("触发事件执行失败", e);
    }
  }
 
  private static interface IAction {
View Full Code Here


    TransactionStatus status = txManager.getTransaction(definition);
    try {
      action.execute(processDefine, processInstance);
      txManager.commit(status);
    } catch (Exception e) {
      txManager.rollback(status);
      throw new ProcessEngineException("触发事件执行失败", e);
    }
  }
 
  private static interface IAction {
View Full Code Here

        PlatformTransactionManager transactionManager = transactionManagerInstance.get();
        TransactionStatus transactionStatus = transactionStatusInstance.get();

        // rollbacks the transaction
        transactionManager.rollback(transactionStatus);
    }

    /**
     * <p>Creates new transaction definition.</p>
     *
 
View Full Code Here

            GrailsIntegration.getGormDomainService().saveDomain(this.sessionInfo);
            updateBlobs(false);
            txManager.commit(status);
        } catch ( Exception t1 ) {
            try {
                txManager.rollback(status);
            } catch ( Throwable t2 ) {
                throw new RuntimeException( "Could not commit session or rollback",
                                            t2 );
            }
            throw new RuntimeException( "Could not commit session",
View Full Code Here

      doTransactional(dataSource, "INSERT INTO COP_AUDIT_TRAIL_EVENT (SEQ_ID, OCCURRENCE, CONVERSATION_ID, LOGLEVEL, CONTEXT, LONG_MESSAGE) VALUES ("+(id++)+", SYSTIMESTAMP, '123', 1, 'CTX', 'Hello World!')");
      System.out.println("wait #2");
      Thread.sleep(10000);
    }
    catch(Exception e) {
      txnManager.rollback(status);
      throw e;
    }
    txnManager.commit(status);
    System.out.println("wait #3");
    Thread.sleep(10000);
View Full Code Here

        if (transactionData.type != TransactionType.NESTED || currentTransactions.size() == 0) {
            TransactionStatus currentStatus = transactionData.getStatus();
            PlatformTransactionManager aTxn = transactionData.getManager();
            if (currentStatus != null && aTxn != null) {
                _log.debug("Rollback Transaction: " + transactionData);
                aTxn.rollback(currentStatus);
            }
        }
        // We must flag all transactions to be rolled back. This is necessary because there is
        // no guarantee we have actually started the transaction, so we may not be able to mark
        // it as being only able to be rolled back.
View Full Code Here

                if (transactionData.rolledBack) {
                    // Something has previously rolled back, forcing this transaction to rollback
                  if (_log.isDebugEnabled()) {
                    _log.debug("Commit Transaction (will rollback): " + transactionData);
                  }
                    aTxn.rollback(currentStatus);
                    statistics.incrementRollbackCount();
                }
                else {
                  if (_log.isDebugEnabled()) {
                    _log.debug("Commit Transaction: " + transactionData);
View Full Code Here

        if (transactionData.type != TransactionType.NESTED || currentTransactions.size() == 0) {
            TransactionStatus currentStatus = transactionData.getStatus();
            PlatformTransactionManager aTxn = transactionData.getManager();
            if (currentStatus != null && aTxn != null) {
                _log.debug("Rollback Transaction: " + transactionData);
                aTxn.rollback(currentStatus);
            }
        }
        // We must flag all transactions to be rolled back. This is necessary because there is
        // no guarantee we have actually started the transaction, so we may not be able to mark
        // it as being only able to be rolled back.
View Full Code Here

                if (transactionData.rolledBack) {
                    // Something has previously rolled back, forcing this transaction to rollback
                  if (_log.isDebugEnabled()) {
                    _log.debug("Commit Transaction (will rollback): " + transactionData);
                  }
                    aTxn.rollback(currentStatus);
                    statistics.incrementRollbackCount();
                }
                else {
                  if (_log.isDebugEnabled()) {
                    _log.debug("Commit Transaction: " + transactionData);
View Full Code Here

        if (transactionData.type != TransactionType.NESTED || currentTransactions.size() == 0) {
            TransactionStatus currentStatus = transactionData.getStatus();
            PlatformTransactionManager aTxn = transactionData.getManager();
            if (currentStatus != null && aTxn != null) {
                _log.debug("Rollback Transaction: " + transactionData);
                aTxn.rollback(currentStatus);
            }
        }
        // We must flag all transactions to be rolled back. This is necessary because there is
        // no guarantee we have actually started the transaction, so we may not be able to mark
        // it as being only able to be rolled back.
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.