当前位置:网站首页>【无标题】JDBC连接数据库读超时
【无标题】JDBC连接数据库读超时
2022-07-27 01:59:00 【wuhui2100】
1、背景
工作中遇到顺便记录一下,在数据量很大的情况下使用jdbc连接到数据库当实际读取时间超过设置的读取时间时会导致读超时。当时客户环境数据为几亿条数据,使用jdbc连接到对应数据库(会将对应的数据全部提交到spark中计算,导致时间过长)监听对应表的数据质量,此时读取的时间超过设定值抛出如下错误
2、使用场景
为了解决上述问题,准备将连接时间设置延长,当读取源码时发现jdbc设置的连接是全局时间,导致其它地方的驱动连接时间会加载到当前驱动的连接时间(吐槽JDBC超时时间为全局操作)


因为是使用hive连接驱动
进入HiveConnection会发现调用的是全局时间

这样会导致我在其它地方的计算也会变成当前设置的连接时间
3、解决办法
目前解决的办法就是延长总体连接时间(引一发动全身)
注:望读到的大佬有好的解决办法可以讨论一下(不能改变JDBC连接的前提)
边栏推荐
- FactoryBean的getObject调用时机
- 数据库概论 - 数据库的介绍
- impala 执行计划详解
- Sqlserver select * can you exclude a field
- docker 创建mysql 8.x容器,支持mac ,arm架构芯片
- 若依框架代码生成详解
- Unity game, the simplest solution of privacy agreement! Just 3 lines of code! (Reprinted)
- Data Lake (20): Flink is compatible with iceberg, which is currently insufficient, and iceberg is compared with Hudi
- Volatile keyword and its function
- 最低票价(DAY 80)
猜你喜欢

Customer cases | pay attention to the elderly user experience, and the transformation of bank app to adapt to aging should avoid falsehood and be practical

Explain

MySQL中文失败问题

图解用户登录验证流程,写得太好了!

A new paradigm of distributed deep learning programming: Global tensor

Worthington过氧化物酶活性的6种测定方法

spark:计算不同分区中相同key的平均值(入门级-简单实现)

Byte side: can TCP and UDP use the same port?

消息被拒MQ

Post responsibilities of safety officer and environmental protection officer
随机推荐
Yilingsi T35 FPGA drives LVDS display screen
Oracle有没有分布式数据库?
C语言const用法详解
[learning notes, dog learning C] string + memory function
索引最佳实践
JMeter distributed pressure measurement
Worthington木瓜蛋白酶解离系统解决方案
volatile关键字及其作用
Acwing 2074. Countdown simulation
延时队列的几种实现姿势?日常必备技能!
百融榕树数据模型
数据库概论 - MySQL的简单介绍
Win10/win11 lossless expansion of C disk space, cross disk consolidation of C and e disks
docker 创建mysql 8.x容器,支持mac ,arm架构芯片
客户案例 | 关注老年用户体验,银行APP适老化改造要避虚就实
Explain tool actual operation
【常用搜索问题】111
Sqlserver select * can you exclude a field
将幕布文章OPML转换为Markdown的方法
Spark Learning Notes (IV) -- spark core programming RDD