[inner-2222] clear the 'sendData' resource in the transaction correctly (cherry pick)

This commit is contained in:
wenyh
2023-05-22 17:51:45 +08:00
committed by wenyh1
parent c91b040f09
commit 40a3fb5821
3 changed files with 7 additions and 1 deletions
@@ -74,6 +74,10 @@ public class TransactionHandlerManager {
}
}
public NormalTransactionHandler getNormalTransactionHandler() {
return (NormalTransactionHandler) normalHandler;
}
public void commit() {
if (xaTxId != null) {
xaHandler.commit();
@@ -69,6 +69,7 @@ public class CommitStage extends Stage implements TransactionStage {
}
private void asyncNext(boolean isFail, String errMsg, MySQLPacket sendData) {
session.getTransactionManager().getNormalTransactionHandler().clearResources();
if (isFail) {
session.setFinishedCommitTime();
session.setResponseTime(false);
@@ -92,6 +93,7 @@ public class CommitStage extends Stage implements TransactionStage {
}
private void syncNext(boolean isFail, String errMsg, MySQLPacket sendData) {
session.getTransactionManager().getNormalTransactionHandler().clearResources();
if (isFail) {
session.getShardingService().setPacketId(0);
if (sendData != null) {
@@ -42,7 +42,7 @@ public class RollbackStage implements TransactionStage {
}
session.setResponseTime(false);
session.getTransactionManager().getNormalTransactionHandler().clearResources();
LOGGER.info("GET INTO THE NET LEVEL AND THE RESULT IS " + isFail);
if (isFail) {
if (sendData != null) {