use of com.syncleus.ferma.WrappedTransaction in project open-kilda by telstra.
the class FermaTransactionAdapter method closeForeignTransactionIfExist.
private void closeForeignTransactionIfExist() throws Exception {
DelegatingFramedGraph<?> graph = getContextExtension().getGraphCreateIfMissing();
WrappedTransaction currentTx = graph.tx();
if (currentTx.isOpen()) {
log.debug("Closing an existing underlying transaction {} on graph {}", currentTx, graph);
commitOrRollback(currentTx, false);
}
}
use of com.syncleus.ferma.WrappedTransaction in project open-kilda by telstra.
the class FermaTransactionAdapter method open.
@Override
public void open() throws Exception {
try {
closeForeignTransactionIfExist();
} catch (PersistenceException e) {
throw e;
} catch (Exception e) {
throw wrapException(e);
}
DelegatingFramedGraph<?> graph = getContextExtension().getGraphCreateIfMissing();
WrappedTransaction transaction = graph.tx();
if (transaction.isOpen()) {
throw new PersistenceException("Attempt to reopen transaction: " + transaction);
}
log.debug("Opening a new transaction {} on graph {}", transaction, graph);
transaction.open();
}
Aggregations