https://github.com/apache/incubator-servicecomb-saga/blob/cc38fe9dca2a4c2f09d949117a61fa0ee2586a5f/omega/omega-transaction/src/main/java/org/apache/servicecomb/saga/omega/transaction/tcc/TccParticipatorAspect.java#L63
As shown in the code below, omega can only send events with the status
TransactionStatus.Failed if an exception is thrown inside the
joinPoint.proceed().
Can we optimize to have no such requirements?
```Java
try {
Object result = joinPoint.proceed();
// Send the participate message back
tccEventService.participate(new ParticipatedEvent(context.globalTxId(),
context.localTxId(), localTxId, confirmMethod,
cancelMethod, TransactionStatus.Succeed));
// Just store the parameters into the context
parametersContext.putParamters(context.localTxId(), joinPoint.getArgs());
LOG.debug("Participate Transaction with context {} has finished.",
context);
return result;
} catch (Throwable throwable) {
// Now we don't handle the error message
tccEventService.participate(new ParticipatedEvent(context.globalTxId(),
context.localTxId(), localTxId, confirmMethod,
cancelMethod, TransactionStatus.Failed));
LOG.error("Participate Transaction with context {} failed.", context,
throwable);
throw throwable;
} finally {
context.setLocalTxId(localTxId);
}
```
[ Full content available at:
https://github.com/apache/incubator-servicecomb-saga/issues/307 ]
This message was relayed via gitbox.apache.org for [email protected]