DBAPI
🏠Home
📃Documents
📃Documents
🧭Guide
🧭Enterprise Edition Guide
⬇️Download
⚙️Installment
🛠️Activate
🔧Plugin
📰Blog
📹︎Video Tutorial
(opens new window)
📜Changelog
⬆️Upgrade
🔍Dynamic SQL
💻Groovy Syntax
❓FAQ
❓FAQ
Common Business Questions
🌳Ecosystem
🌳Ecosystem
🛒Plugin Market
(opens new window)
✉️Contact
🏢Enterprise Edition
💰Purchase
💰Purchase
Enterprise Edition DBAPI License
(opens new window)
Individual Edition DBAPI License
(opens new window)
🌍Languages
🌍Languages
English
简体中文
#
数据库连接断开后,DBAPI的数据源如何自动重连
#
现象
在使用DBAPI的过程中,如果网络抖动导致数据库连接不上,发现DBAPI的数据源不能重连,必须重启DBAPI才能连上数据库
#
解决办法
#
方案一:配置数据源参数
在数据源的连接池参数配置
druid.breakAfterAcquireFailure=false
注意在企业版的
4.1.1
及以上版本才可以配置连接池参数
#
方案二:手动重置数据库连接池
企业版
4.3.0
开始,支持手动重置数据库连接池