fix:'begin',the sql that follows commits implicitly(inner 867)

This commit is contained in:
wd2365151147
2021-01-27 10:29:55 +08:00
parent 7ff3c8dc53
commit 43e37cb792
3 changed files with 11 additions and 10 deletions
@@ -11,6 +11,7 @@ import com.actiontech.dble.server.variables.MysqlVariable;
import java.util.concurrent.atomic.AtomicLong;
public abstract class BusinessService extends FrontEndService {
protected volatile boolean txChainBegin;
protected volatile boolean txStarted;
protected final AtomicLong queriesCounter = new AtomicLong(0);
protected final AtomicLong transactionsCounter = new AtomicLong(0);
@@ -25,7 +26,11 @@ public abstract class BusinessService extends FrontEndService {
}
public void setTxStart(boolean txStart) {
this.txStarted = txStart;
if (!txStart && txChainBegin) {
txChainBegin = false;
} else {
this.txStarted = txStart;
}
}
public void queryCount() {
@@ -72,7 +72,6 @@ public class ShardingService extends BusinessService {
private final MySQLShardingSQLHandler shardingSQLHandler;
protected String executeSql;
private volatile boolean txChainBegin;
private volatile boolean txInterrupted;
private volatile String txInterruptMsg = "";
@@ -615,14 +614,6 @@ public class ShardingService extends BusinessService {
TraceManager.sessionStart(this, "sharding-server-start");
}
public boolean isTxChainBegin() {
return txChainBegin;
}
public void setTxChainBegin(boolean txChainBegin) {
this.txChainBegin = txChainBegin;
}
public boolean isTxInterrupted() {
return txInterrupted;
}
@@ -261,6 +261,11 @@ public class RWSplitService extends BusinessService {
return expectedDest;
}
@Override
public void setTxStart(boolean txStart) {
this.txStarted = txStart;
}
@Override
public void killAndClose(String reason) {
session.close(reason);