使用HIVE-JDBC+TOMCAT-JDBC连接(CONNECTION)中断的处理过程

现象描述
Hive环境一个数据库,拥有表8000+,业务代码需要挨个desc {tableName}来获取表信息。当程序运行到4000+左右,开始出现获取信息失败。

查找原因
通过查看日志发现是连接已断开,具体如下:

【INFO】org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: java.sql.SQLException: Connection has already been closed.

The error may exist in 省略/HiveCollectionMapper.xml

The error may involve 省略.HiveCollectionMapper.getTableParameters

The error occurred while executing a query

SQL: desc formatted logsget.dim_qdas_superderive_eventlist

猜你喜欢

转载自blog.csdn.net/weixin_43214644/article/details/125918701