提交 36c27725 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Remove code for protocol versions below 8 from SessionRemote.setAutoCommitSend()

上级 20371d3e
...@@ -73,7 +73,6 @@ public class SessionRemote extends SessionWithState implements DataHandler { ...@@ -73,7 +73,6 @@ public class SessionRemote extends SessionWithState implements DataHandler {
private ArrayList<Transfer> transferList = New.arrayList(); private ArrayList<Transfer> transferList = New.arrayList();
private int nextId; private int nextId;
private boolean autoCommit = true; private boolean autoCommit = true;
private CommandInterface autoCommitFalse, autoCommitTrue;
private ConnectionInfo connectionInfo; private ConnectionInfo connectionInfo;
private String databaseName; private String databaseName;
private String cipher; private String cipher;
...@@ -246,31 +245,15 @@ public class SessionRemote extends SessionWithState implements DataHandler { ...@@ -246,31 +245,15 @@ public class SessionRemote extends SessionWithState implements DataHandler {
} }
private synchronized void setAutoCommitSend(boolean autoCommit) { private synchronized void setAutoCommitSend(boolean autoCommit) {
if (clientVersion >= Constants.TCP_PROTOCOL_VERSION_8) { for (int i = 0, count = 0; i < transferList.size(); i++) {
for (int i = 0, count = 0; i < transferList.size(); i++) { Transfer transfer = transferList.get(i);
Transfer transfer = transferList.get(i); try {
try { traceOperation("SESSION_SET_AUTOCOMMIT", autoCommit ? 1 : 0);
traceOperation("SESSION_SET_AUTOCOMMIT", autoCommit ? 1 : 0); transfer.writeInt(SessionRemote.SESSION_SET_AUTOCOMMIT).
transfer.writeInt(SessionRemote.SESSION_SET_AUTOCOMMIT). writeBoolean(autoCommit);
writeBoolean(autoCommit); done(transfer);
done(transfer); } catch (IOException e) {
} catch (IOException e) { removeServer(e, i--, ++count);
removeServer(e, i--, ++count);
}
}
} else {
if (autoCommit) {
if (autoCommitTrue == null) {
autoCommitTrue = prepareCommand(
"SET AUTOCOMMIT TRUE", Integer.MAX_VALUE);
}
autoCommitTrue.executeUpdate(false);
} else {
if (autoCommitFalse == null) {
autoCommitFalse = prepareCommand(
"SET AUTOCOMMIT FALSE", Integer.MAX_VALUE);
}
autoCommitFalse.executeUpdate(false);
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论