Example usage for javax.transaction TransactionManager commit

List of usage examples for javax.transaction TransactionManager commit

Introduction

In this page you can find the example usage for javax.transaction TransactionManager commit.

Prototype

public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
        SecurityException, IllegalStateException, SystemException;

Source Link

Document

Complete the transaction associated with the current thread.

Usage

From source file:org.wso2.carbon.rssmanager.data.mgt.retriever.util.StorageUsageTransactionManager.java

public void commit() throws UsageManagerException {
    /* if we didn't begin this transaction, don't commit it */
    if (!this.beginTx.get()) {
        return;/*w ww  .j a  va 2s  .  com*/
    }
    TransactionManager txManager = getTransactionManager();
    try {
        if (log.isDebugEnabled()) {
            log.debug("transactionManager.commit()");
        }
        txManager.commit();
    } catch (Exception e) {
        throw new UsageManagerException("Error from transaction manager when committing", e);
    } finally {
        this.beginTx.set(false);
    }
}