Package org.springframework.jdbc.datasource

Examples of org.springframework.jdbc.datasource.DataSourceTransactionManager.rollback()


      }
    }
    // If creating the table fails, roll back the transaction and error
    // out.
    catch(DataAccessException e) {
      transactionManager.rollback(transactionStatus);
      throw
        new IllegalStateException(
          "There was an issue creating a DAO table definition.",
          e);
    }
View Full Code Here


    // Commit the transaction.
    try {
      transactionManager.commit(transactionStatus);
    }
    catch(TransactionException e) {
      transactionManager.rollback(transactionStatus);
      throw
        new IllegalStateException(
          "There was an error committing the transaction.",
          e);
    }
View Full Code Here

      TransactionStatus txStatus = tm.getTransaction(new DefaultTransactionDefinition());
      try {
        try {
          next.evaluate();
        } catch (Throwable e) {
          tm.rollback(txStatus);
          throw e;
        }
        tm.commit(txStatus);
      } finally {
        database.shutdown();       
View Full Code Here

        rollbackCount.addAndGet(1);
       
        DataSourceTransactionManager txManager = this.transactionManagers.get(dataSource);
        TransactionStatus currentStatus = ((MultiDataSourcesTransactionStatus)status).get(dataSource);

        txManager.rollback(currentStatus);

        log.info("Roll back JDBC transaction success");
      } catch (Throwable e) {
        log.info("Could not roll back JDBC transaction", e);
        ex = e;
View Full Code Here

  public final static void forceEndTransactional() {
    PlatformTransactionManager platformTransactionManager = new DataSourceTransactionManager(DBEnvironmentFactory
        .getCurrentDBEnvironment().getDataSource(false));
    TransactionStatus status = platformTransactionManager.getTransaction(new DefaultTransactionDefinition(
        TransactionDefinition.PROPAGATION_REQUIRED));
    platformTransactionManager.rollback(status);
  }
}
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.