Example usage for org.springframework.transaction.support DefaultTransactionStatus flush

List of usage examples for org.springframework.transaction.support DefaultTransactionStatus flush

Introduction

In this page you can find the example usage for org.springframework.transaction.support DefaultTransactionStatus flush.

Prototype

@Override
public void flush() 

Source Link

Document

Delegate the flushing to the transaction object, provided that the latter implements the SmartTransactionObject interface.

Usage

From source file:org.cfr.capsicum.datasource.CayenneTransactionManager.java

@Override
protected void doCommit(DefaultTransactionStatus status) {
    CayenneTransactionObject txObject = (CayenneTransactionObject) status.getTransaction();
    Connection con = txObject.getConnectionHolder().getConnection();
    if (status.isDebug()) {
        logger.debug("Committing JDBC transaction on Connection [" + con + "]");
    }//from  w  ww  .  j av  a  2 s  .c  o  m
    try {
        status.flush();
        con.commit();
    } catch (SQLException ex) {
        throw new TransactionSystemException("Could not commit JDBC transaction",
                exceptionTranslator.convertJdbcAccessException(ex));
    } catch (CayenneRuntimeException ex) {
        throw new TransactionSystemException("Could not commit JDBC transaction",
                exceptionTranslator.convertAccessException(ex));
    }
}