TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: iot - Connection is not available, request timed out after 30000ms

Open hecao100 opened this issue 3 years ago • 10 comments

Version:3017

Caused by: org.apache.ibatis.exceptions.PersistenceException:

Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: iot - Connection is not available, request timed out after 30000ms.

The error may exist in URL [jar:file:/data/TSP/soa-sequence-data-v0.0.1.jar!/BOOT-INF/classes!/mapper/TdBikeBattRecMapper.xml]

The error may involve com.yadea.iot.tsp.soa.sequence.data.mapper.TdBikeBattRecMapper.insertBatch

The error occurred while executing an update

Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: iot - Connection is not available, request timed out after 30000ms.

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
at sun.reflect.GeneratedMethodAccessor146.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
... 12 common frames omitted

Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLTransientConnectionException: iot - Connection is not available, request timed out after 30000ms.

hecao100 avatar Nov 28 '22 01:11 hecao100

3015-3016 没有遇到过这个问题,升级到 3017 后,连接会偶发性的报错: java.sql.SQLTransientConnectionException: iot - Connection is not available, request timed out after 30000ms.导致数据写入失败。

JNI 内网连接并发 50 左右,jdbc驱动版本 3012 ,客户端和服务端均已升级到 3.0.1.7 。

hecao100 avatar Nov 30 '22 03:11 hecao100

使用的是hikari连接池,通过mybatis,使用jdbc驱动写入数据

hikari: maximumPoolSize: 100 minimumIdle: 10 idleTimeout: 600000 connectionTimeout: 30000 maxLifetime: 1800000

hecao100 avatar Nov 30 '22 03:11 hecao100

批量写入的代码如下 <insert id="insertBatch" parameterType="com.test.entity.BikeRec"> insert into ${tableName} USING bike_rec TAGS (#{list[0].a0}) values <foreach collection="list" item="item" index="idx" separator=","> ( #{item.ts}, #{item.a1}, #{item.a2}, #{item.a3}, #{item.a4}, #{item.a5}, #{item.a6}, #{item.a7}, #{item.a8}, #{item.a9}, #{item.a10}, #{item.a11}, #{item.a12}, #{item.a13}, #{item.a14}, #{item.a15}, #{item.a16}, #{item.a17}, #{item.a18}, #{item.a19}, #{item.a20}, #{item.a21}, #{item.a22}, #{item.a23}, #{item.a24}, #{item.a25}, #{item.a26}, #{item.a27}, #{item.a28}, #{item.a29}, #{item.a30}, #{item.a31}, #{item.a32}, #{item.a33}, #{item.a34}, #{item.a35}, #{item.a36}, #{item.a37}, #{item.a38}, #{item.a39}, #{item.a40}, #{item.a41}, #{item.a42}, #{item.a43}, #{item.a44}, #{item.a45}, #{item.a46}, #{item.a47}, #{item.a48}, #{item.a49}, #{item.a50}, #{item.a51}, #{item.a52}, #{item.a53}, #{item.a54}, #{item.a55}, #{item.a56}, #{item.a57}, #{item.a58}, #{item.a59}, #{item.a60}, #{item.a61}, #{item.a62} ) </foreach> </insert>

hecao100 avatar Nov 30 '22 03:11 hecao100

我们也是同样的问题,在升级在3.0.1.7版本后,偶尔会出现jdbc获得不到链接的情况,jdbc的驱动是最新的,期待官方早日解决

dudan57 avatar Nov 30 '22 06:11 dudan57

丢数据是很严重的问题,版本什么时候能稳定,一直都有问题就要换方案弃用tdengine了

jackconfeng avatar Nov 30 '22 06:11 jackconfeng

丢数据是很严重的问题,版本什么时候能稳定,一直都有问题就要换方案弃用tdengine了

我还在考虑要不要弃坑了

hecao100 avatar Nov 30 '22 06:11 hecao100

我们也是同样的问题,在升级在3.0.1.7版本后,偶尔会出现jdbc获得不到链接的情况,jdbc的驱动是最新的,期待官方早日解决

官方一直没解决

hecao100 avatar Nov 30 '22 06:11 hecao100

此问题在升级成为3018版本后解决

hecao100 avatar Dec 02 '22 09:12 hecao100

此问题在升级成为3018版本后解决

hecao100 avatar Dec 02 '22 09:12 hecao100

升级到3018,运行一段时间之后,此问题又出现了

hecao100 avatar Dec 03 '22 00:12 hecao100

丢数据是很严重的问题,版本什么时候能稳定,一直都有问题就要换方案弃用tdengine了

3.0.2.0 已经解决这个问题,可以升级。

3.0.2.x 是稳定版,后续不会再新增新功能,只会做问题修复,可以跟着官方版本做升级。

yu285 avatar Dec 13 '22 05:12 yu285

升级到3.0.4.2还是存在同样的问题 image image

BigData-Dong avatar Jun 09 '23 08:06 BigData-Dong