Commit 4a9d88d8 by WeiCong

增加bd提前退出交易机制

parent 60001fbe
...@@ -5,7 +5,7 @@ public class ExitTransactionException extends RuntimeException { ...@@ -5,7 +5,7 @@ public class ExitTransactionException extends RuntimeException {
private String errorCode; private String errorCode;
public ExitTransactionException(String message, String errorCode) { public ExitTransactionException(String errorCode,String message) {
super(message); super(message);
this.errorCode = errorCode; this.errorCode = errorCode;
} }
......
...@@ -188,14 +188,15 @@ public abstract class AbstractCommonController { ...@@ -188,14 +188,15 @@ public abstract class AbstractCommonController {
ret = ResultUtil.result(NoUiPresentationUtil.retCode(context), NoUiPresentationUtil.retMsg(context), afterReturnData,paginationData, ret = ResultUtil.result(NoUiPresentationUtil.retCode(context), NoUiPresentationUtil.retMsg(context), afterReturnData,paginationData,
NoUiPresentationUtil.handleErrorReturnData(context, alias), NoUiPresentationUtil.handleCodeTableReturnData(context, alias), noUiVersion.getVersion()); NoUiPresentationUtil.handleErrorReturnData(context, alias), NoUiPresentationUtil.handleCodeTableReturnData(context, alias), noUiVersion.getVersion());
} }
catch (ExitTransactionException exitTrans)
{
ret = ResultUtil.result(exitTrans.getErrorCode(), exitTrans.getMessage(), "service error", noUiVersion.getVersion());
}
catch (Throwable e) { catch (Throwable e) {
log.error("OnClick command error", e); if(e.getCause() instanceof ExitTransactionException){
ret = ResultUtil.result(ErrorCodes.ERROR, "hander error", "service error", noUiVersion.getVersion()); ExitTransactionException exitTrans=ExitTransactionException.class.cast(e.getCause());
TxInfo.recordException(e); ret = ResultUtil.result(exitTrans.getErrorCode(), exitTrans.getMessage(), exitTrans.getMessage(), noUiVersion.getVersion());
}else{
log.error("OnClick command error", e);
ret = ResultUtil.result(ErrorCodes.ERROR, "hander error", "service error", noUiVersion.getVersion());
TxInfo.recordException(e);
}
} finally { } finally {
if (context != null) { if (context != null) {
//context.getSupport().disconnect(); //context.getSupport().disconnect();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment