提交 abc39a13 authored 作者: Thomas Mueller's avatar Thomas Mueller

Cluster: auto-commit was disabled after opening a connection.

Connection.getAutoCommit() is now much faster, specially when using the server mode.
上级 c9eb1697
......@@ -71,12 +71,12 @@ public class TcpServerThread implements Runnable {
int minClientVersion = transfer.readInt();
if (minClientVersion < Constants.TCP_PROTOCOL_VERSION_6) {
throw DbException.get(ErrorCode.DRIVER_VERSION_ERROR_2, "" + clientVersion, "" + Constants.TCP_PROTOCOL_VERSION_6);
} else if (minClientVersion > Constants.TCP_PROTOCOL_VERSION_7) {
throw DbException.get(ErrorCode.DRIVER_VERSION_ERROR_2, "" + clientVersion, "" + Constants.TCP_PROTOCOL_VERSION_7);
} else if (minClientVersion > Constants.TCP_PROTOCOL_VERSION_8) {
throw DbException.get(ErrorCode.DRIVER_VERSION_ERROR_2, "" + clientVersion, "" + Constants.TCP_PROTOCOL_VERSION_8);
}
int maxClientVersion = transfer.readInt();
if (maxClientVersion >= Constants.TCP_PROTOCOL_VERSION_7) {
clientVersion = Constants.TCP_PROTOCOL_VERSION_7;
if (maxClientVersion >= Constants.TCP_PROTOCOL_VERSION_8) {
clientVersion = Constants.TCP_PROTOCOL_VERSION_8;
} else {
clientVersion = minClientVersion;
}
......@@ -356,6 +356,12 @@ public class TcpServerThread implements Runnable {
transfer.writeInt(SessionRemote.STATUS_OK).flush();
break;
}
case SessionRemote.SESSION_SET_AUTOCOMMIT: {
boolean autoCommit = transfer.readBoolean();
session.setAutoCommit(autoCommit);
transfer.writeInt(SessionRemote.STATUS_OK).flush();
break;
}
default:
trace("Unknown operation: " + operation);
closeSession();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论