[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 af29c6ba96
commit 8fe3eda0eb
3 changed files with 7 additions and 1 deletions

View File

@@ -65,6 +65,10 @@ public class TransactionHandlerManager {
}
}
public NormalTransactionHandler getNormalTransactionHandler() {
return (NormalTransactionHandler) normalHandler;
}
public void commit() {
if (xaTxId != null) {
xaHandler.commit();

View File

@@ -64,6 +64,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);
@@ -87,6 +88,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) {

View File

@@ -37,7 +37,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) {