Skip to content

Commit ac5791f

Browse files
committed
FIX 当 dtx timeout.时抛出LcnBusinessException异常之后 第二次ex.getCause() 会抛java.lang.NullPointException
1 parent 1f95ecd commit ac5791f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

txlcn-tc/src/main/java/com/codingapi/txlcn/tc/core/template/TransactionControlTemplate.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public void notifyGroup(String groupId, String unitId, String transactionType, i
143143
txLogger.txTrace(
144144
groupId, unitId, "notify group > transaction type: {}, state: {}.", transactionType, state);
145145
if (globalContext.isDTXTimeout()) {
146+
txLogger.trace(groupId, unitId, Transactions.TE, "dtx timeout.");
146147
throw new LcnBusinessException("dtx timeout.");
147148
}
148149
state = reliableMessenger.notifyGroup(groupId, state);
@@ -153,7 +154,7 @@ public void notifyGroup(String groupId, String unitId, String transactionType, i
153154
dtxExceptionHandler.handleNotifyGroupMessageException(Arrays.asList(groupId, state, unitId, transactionType), e);
154155
} catch (LcnBusinessException e) {
155156
// 关闭事务组失败
156-
dtxExceptionHandler.handleNotifyGroupBusinessException(Arrays.asList(groupId, state, unitId, transactionType), e.getCause());
157+
dtxExceptionHandler.handleNotifyGroupBusinessException(Arrays.asList(groupId, state, unitId, transactionType), e);
157158
}
158159
txLogger.txTrace(groupId, unitId, "notify group exception state {}.", state);
159160
}

0 commit comments

Comments
 (0)