You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.sql.SQLException: connection disabled
at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1170) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledConnection.java:1155) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.setAutoCommit(DruidPooledConnection.java:703) ~[druid-1.2.4.jar:1.2.4]
at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.begin(AbstractLogicalConnectionImplementor.java:72) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final]
... 95 more
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:719) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
at org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:736) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
Error Info
报错如下
Caused by: java.sql.SQLException: connection disabled
at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1170) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledConnection.java:1155) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.setAutoCommit(DruidPooledConnection.java:703) ~[druid-1.2.4.jar:1.2.4]
at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.begin(AbstractLogicalConnectionImplementor.java:72) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final]
... 95 more
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:719) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
at org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:736) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
By setting closeConnOnFatalError to false, Druid's behavior will align with HikariCP, that is, the connection will no longer be closed when a fatal error defined by Druid occurs. This solves a series of controversies surrounding Hibernate, Flyway, and ShardingSphere. This is a huge regret introduced from 882470b 7 years ago.
Database Type
Postgresql
Database Version
无
Druid Version
1.2.4
JDK Version
JDK8
Error SQL
无
Testcase Code
No response
Stacktrace Info
Caused by: java.sql.SQLException: connection disabled
at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1170) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledConnection.java:1155) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.setAutoCommit(DruidPooledConnection.java:703) ~[druid-1.2.4.jar:1.2.4]
at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.begin(AbstractLogicalConnectionImplementor.java:72) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final]
... 95 more
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:719) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
at org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:736) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
Error Info
报错如下
Caused by: java.sql.SQLException: connection disabled
at com.alibaba.druid.pool.DruidPooledConnection.checkStateInternal(DruidPooledConnection.java:1170) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.checkState(DruidPooledConnection.java:1155) ~[druid-1.2.4.jar:1.2.4]
at com.alibaba.druid.pool.DruidPooledConnection.setAutoCommit(DruidPooledConnection.java:703) ~[druid-1.2.4.jar:1.2.4]
at org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor.begin(AbstractLogicalConnectionImplementor.java:72) ~[hibernate-core-5.6.9.Final.jar:5.6.9.Final]
... 95 more
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:719) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
at org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:736) ~[gsjdbc4-V100R003C10SPC120B100.jar:?]
连接池配置如下
druid.initialSize=10
druid.maxActive=1000
druid.minIdle=50
druid.validationQuery=select 1
druid.testWhileIdle=true
druid.timeBetweenEvictionRunsMillis=10000
druid.minEvictableIdleTimeMillis=300000
druid.testOnBorrow=false
druid.testOnReturn=false
自定定位情况
看了获取连接的代码
连接已经获取到了,然后再hibernate开启事务时校验连接时报错”connection disabled“
从代码可以看出,先判断了 连接的状态,应该是判断到连接未关闭,但是开启事务时,发现druid维持的连接状态为disabled状态
疑问
这个问题在后续某个版本修复了吗?是在哪个版本修复的?
又或者 我的druid配置不当?
The text was updated successfully, but these errors were encountered: