use of io.narayana.lra.coordinator.domain.model.LRAStatus in project narayana by jbosstm.
the class LRAService method endLRA.
public LRAStatus endLRA(URL lraId, boolean compensate, boolean fromHierarchy) {
lraTrace(lraId, "end LRA");
Transaction transaction = getTransaction(lraId);
if (!transaction.isActive() && !transaction.isRecovering() && transaction.isTopLevel())
throw new IllegalLRAStateException(lraId.toString(), "LRA is closing or closed", "endLRA");
transaction.end(compensate);
if (transaction.currentLRA() != null)
if (LRALogger.logger.isInfoEnabled())
LRALogger.logger.infof("LRAServicve.endLRA LRA %s ended but is still associated with %s%n", lraId, transaction.currentLRA().get_uid().fileStringForm());
finished(transaction, fromHierarchy);
if (transaction.isTopLevel()) {
// forget any nested LRAs
// instruct compensators to clean up
transaction.forgetAllParticipants();
}
return new LRAStatus(transaction);
}
Aggregations