TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

If the return value of JDBC Driver with Druid exceeds a certain number, an error will be reported

Open colo1994 opened this issue 6 years ago • 6 comments

版本 1.6.5.5 同一个查询接口,SQL语句在命令行中均可以执行。 JDBC在小数据量时不报错,大数据量报错,报错信息如下: 出现在我对结果集遍历的时候 java.sql.SQLException: TDengine Error: invalid resultset pointer! at com.taosdata.jdbc.TSDBResultSet.next(TSDBResultSet.java:129) at com.alibaba.druid.filter.FilterChainImpl.resultSet_next(FilterChainImpl.java:917) at com.alibaba.druid.filter.FilterAdapter.resultSet_next(FilterAdapter.java:1918) at com.alibaba.druid.filter.FilterChainImpl.resultSet_next(FilterChainImpl.java:913) at com.alibaba.druid.proxy.jdbc.ResultSetProxyImpl.next(ResultSetProxyImpl.java:882) at com.alibaba.druid.pool.DruidPooledResultSet.next(DruidPooledResultSet.java:69) at com.jysoft.server.Test.executeSql(Test.java:166)

colo1994 avatar Mar 31 '20 09:03 colo1994

Same as #1307 Please add my wechat 13720014098, and let us discuss the log.

Shawshank-Smile avatar Mar 31 '20 14:03 Shawshank-Smile

Use TCP instead of UDP for transporting data, and this problem will not show again.

是在/etc/taos/taos.cfg 中文件sockettype 改成 tcp吗? 我再服务端打开了这个#号,修改为tcp ,然后重启服务可以了。 我本地的电脑是Windows,在C:\TDengine\cfg\taos.cfg 中sockettype 修改为tcp 然后再本地调用一个查询,报错了,日志如下

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fec0f30191, pid=152692, tid=0x0000000000037c80

JRE version: Java(TM) SE Runtime Environment (8.0_191-b12) (build 1.8.0_191-b12)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.191-b12 mixed mode windows-amd64 compressed oops)

Problematic frame:

C [taos.dll+0xf0191]

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

看样子是taos.dll 的问题,是我修改错了地方吗? 我的jar包是1.0.3版本

colo1994 avatar Apr 03 '20 01:04 colo1994

This problem will be finally solved by TDengine 2.0 , which will be available very soon.

Shawshank-Smile avatar Apr 03 '20 13:04 Shawshank-Smile

The "invalid resultset pointer" exception is most likely caused by an unexpected release of the result set pointer at TDengine server side (taosd). Here is how the whole process works. After each query, there will be a result set whose information is stored in the taosd process. The TDengine client (in this case, your Java program) retrieves data of the result set in a block-wise way, i.e. each retrieval fetches a single block of data from the server side. However, there is a timeout threshold for taosd between two consecutive data block retrievals for the same result set. The timeout threshold is set to 3 seconds by default, which honestly is not very long. There are situations that can lead to a timeout for data retrieval, for example poor network connection, a slow cursor moving in JDBC or other connectors etc.

To avoid the server timeout, try increasing the timeout threshold to a larger value, e.g. 20 seconds by modifying the parameter named "shellActivityTimer" in taosd's configuration file. Add the line below in TDengine's configuration file, which by default is at /etc/taos/taos.cfg. shellActivityTimer 20 After updating the taos.cfg file, restart taosd to load the new configuration. And then you should have a more patient taosd to keep your result set alive.

johnnyhou327 avatar Apr 11 '20 02:04 johnnyhou327

改为tcp ,然后重启服务可以了。 我本地的电脑是Windows,在C:\TDengine\cfg\taos.cfg 中sockettype 修改为tcp 然后再本地调用一个查询,报错了,日志如下

我遇到了相同的问题,LZ解决了吗?

Chaexsy avatar Jul 02 '20 11:07 Chaexsy

把tdengine和taos-jdbcdriver更新到最新版本,这个问题在新版本中不在出现了。我们检查了多线程操作结果集的逻辑,现在可以规避这个问题了。

zyyang90 avatar Mar 22 '21 02:03 zyyang90