Example usage for org.apache.commons.transaction.file FileResourceManager startTransaction

List of usage examples for org.apache.commons.transaction.file FileResourceManager startTransaction

Introduction

In this page you can find the example usage for org.apache.commons.transaction.file FileResourceManager startTransaction.

Prototype

public void startTransaction(Object txId) throws ResourceManagerException 

Source Link

Usage

From source file:de.thorstenberger.examServer.dao.AbstractTransactionalFileIO.java

/**
 * Start a new transaction on the current working directory.
 *
 * @return an unique transaction id/*w  w  w  . j ava 2  s  .  c o m*/
 */
protected String startTransaction() {
    final FileResourceManager frm = resourceManagers.get(workingPath);
    try {
        final String txId = frm.generatedUniqueTxId();
        frm.startTransaction(txId);
        return txId;
    } catch (final ResourceManagerSystemException e) {
        throw new TaskModelPersistenceException("Could not start new transaction on directory " + workingPath,
                e);
    } catch (final ResourceManagerException e) {
        throw new TaskModelPersistenceException("Could not start new transaction on directory " + workingPath,
                e);
    }
}