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

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

Introduction

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

Prototype

public String generatedUniqueTxId() throws ResourceManagerSystemException 

Source Link

Document

Generates a transaction identifier unique to this resource manager.

Usage

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

/**
 * Start a new transaction on the current working directory.
 *
 * @return an unique transaction id//from  www  .  ja  va2s . 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);
    }
}