Hakunata commented on issue #733:
URL:
https://github.com/apache/servicecomb-pack/issues/733#issuecomment-1048906636
>
感谢及时回复~
`
@Around("execution(@org.apache.servicecomb.pack.omega.transaction.annotations.Participate
* *(..)) && @annotation(participate)")
Object advise(ProceedingJoinPoint joinPoint, Participate participate)
throws Throwable {
Method method =
((MethodSignature)joinPoint.getSignature()).getMethod();
TransactionContext transactionContext =
this.extractTransactionContext(joinPoint.getArgs());
if (transactionContext != null) {
this.populateOmegaContext(this.context, transactionContext);
}
String localTxId = this.context.localTxId();
String cancelMethod = this.callbackMethodSignature(joinPoint,
participate.cancelMethod(), method);
String confirmMethod = this.callbackMethodSignature(joinPoint,
participate.confirmMethod(), method);
this.context.newLocalTxId();
LOG.debug("Updated context {} for participate method {} ",
this.context, method.toString());
Object var10;
try {
AlphaResponse response =
this.tccMessageSender.participationStart(new
ParticipationStartedEvent(this.context.globalTxId(), this.context.localTxId(),
localTxId, confirmMethod, cancelMethod));
if (response.aborted()) {
throw new OmegaException("transcation has aborted: " +
this.context.globalTxId());
}
Object result = joinPoint.proceed();
this.tccMessageSender.participationEnd(new
ParticipationEndedEvent(this.context.globalTxId(), this.context.localTxId(),
localTxId, confirmMethod, cancelMethod, TransactionStatus.Succeed));
this.parametersContext.putParameters(this.context.localTxId(),
joinPoint.getArgs());
LOG.debug("Participate Transaction with context {} has
finished.", this.context);
var10 = result;
} catch (Throwable var14) {
if (!(var14 instanceof OmegaException)) {
// **********************************************
// DEBUG断点到这里,异常是捕获到了的
// **********************************************
this.tccMessageSender.participationEnd(new
ParticipationEndedEvent(this.context.globalTxId(), this.context.localTxId(),
localTxId, confirmMethod, cancelMethod, TransactionStatus.Failed));
}
LOG.error("Participate Transaction with context {} failed.",
this.context, var14);
throw var14;
} finally {
this.context.setLocalTxId(localTxId);
}
return var10;
}`
进入TccParticipatorAspect 类打断点,看到是捕获到异常了。目前POC
ServiceComb-Pack,帮忙看看,目前没来得及读完框架代码
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]