Skip to content

Commit

Permalink
修正多数据源事务支持
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Jul 27, 2023
1 parent 300840e commit 86c4792
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ private TxnState getTxnState(String txnGroup, boolean allowCreate) {
}
state.newlyCreated = true;
}
} else {
txn = transactionManager.getRegisteredTransaction(txnGroup);
if (txn == null && allowCreate) {
// 只是新建事务对象,但是并没有调用open打开事务
txn = transactionManager.newTransaction(txnGroup);
state.newlyCreated = true;
state.prevTxn = transactionManager.registerTransaction(txn);
}
}
state.txn = txn;
state.groupTxn = groupTxn;
Expand Down

0 comments on commit 86c4792

Please sign in to comment.