Skip to content

Commit 960b9e0

Browse files
authored
fix obVersion in direct load (#320)
1 parent 6563fc7 commit 960b9e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/alipay/oceanbase/rpc/direct_load/ObDirectLoadConnection.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ private void initCheck() throws ObDirectLoadException {
176176

177177
private void initProtocol() throws ObDirectLoadException {
178178
// 构造一个连接, 获取版本号
179+
long obVersion = 0;
179180
ObTable table = null;
180181
synchronized (connectionFactory) { // 防止并发访问ObGlobal.OB_VERSION
181182
ObGlobal.OB_VERSION = 0;
@@ -191,8 +192,9 @@ private void initProtocol() throws ObDirectLoadException {
191192
} catch (Exception e) {
192193
throw new ObDirectLoadException(e);
193194
}
195+
obVersion = ObGlobal.OB_VERSION;
194196
}
195-
this.protocol = ObDirectLoadProtocolFactory.getProtocol(traceId, ObGlobal.OB_VERSION);
197+
this.protocol = ObDirectLoadProtocolFactory.getProtocol(traceId, obVersion);
196198
this.protocol.init();
197199
table.close();
198200
}

0 commit comments

Comments
 (0)