PostgreSQL,问题排查:Acquistion Attempt Failed!!! Clearing pending acquires...
Acquistion Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts(30).
......
This ResultSet is closed.
排查思路:
1、数据库没有连上,检查数据库配置;
2、网络不稳定,数据库时而连上时而断开连接;
3、用户数达到配置上限导致连不上:
通过在数据库连接工具Navicat(或是别的工具),在数据库中查询“当前连接数”和“最大允许连接数”,sql如下:
show count(*) from pg_stat_activity;--查询当前连接数
show max_connections;--查询最大连接数
(也可查看postgresql配置文件查看最大连接数:postgresql.auto.conf和postgresql.conf)
4、数据库驱动和数据库版本不匹配导致;
如果你的项目是maven来管理依赖包的话,可以修改maven中数据库驱动依赖包,使用较高版本(可匹配数据库版本)的依赖包。
实际排查:
项目和数据库部署在同一套服务器,不存在网络问题;于是我就检查了数据库连接数问题,当前连接数9,最大允许连接数2000;于是我检查了数据库版本,与驱动,发现数据库版本较高,而驱动比较低,我换了高版本驱动,问题得到了解决。
希望能帮到你们!
---------------------
作者:Walter·Sun
来源:CSDN
原文:https://blog.csdn.net/Soul_Programmer_Swh/article/details/85319330
版权声明:本文为博主原创文章,转载请附上博文链接!