作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Mysql 数据库服务器上使用 dropwizard。此服务器的最大连接值设置为 32,每次获取事件连接数都会增加,一旦达到 32,我就会收到 PoolExhaustedException。
请注意,我只在需要时打开和关闭 session ,并且只创建一次连接。以下是我的 yaml 中的一些数据库配置
database:
# the name of your JDBC driver
driverClass: com.mysql.jdbc.Driver
# the username
user: root
# the JDBC URL
url: jdbc:mysql://localhost:3306/deploys?autoReconnect=true?
# any properties specific to your JDBC driver:
properties:
charSet: UTF-8
hibernate.dialect: org.hibernate.dialect.MySQLDialect
hibernate.hbm2ddl.auto: update
hibernate.show_sql: true
# the maximum amount of time to wait on an empty pool before throwing an exception
maxWaitForConnection: 1s
# the SQL query to run when validating a connection's liveness
validationQuery: "/* MyApplication Health Check */ SELECT 1"
# the minimum number of connections to keep open
minSize: 8
# the maximum number of connections to keep open
maxSize: 32
# whether or not idle connections should be validated
checkConnectionWhileIdle: false
#Whether or not connections will be validated before being borrowed from the pool. If the connection fails to validate, it will be dropped from the pool, and another will be borrowed.
checkConnectionOnBorrow: true
不确定发生了什么,但是 autorecoonect 应该是假的吗?或者是否有一个配置来终止连接池中的放弃连接?
最佳答案
尝试增加 maxWaitForConnection
值。
关于mysql - Dropwizard 服务器中的 PoolExhaustedException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30326486/
我在 Mysql 数据库服务器上使用 dropwizard。此服务器的最大连接值设置为 32,每次获取事件连接数都会增加,一旦达到 32,我就会收到 PoolExhaustedException。 请
我们最近在 Tomcat 上运行的应用程序遇到了一个问题。该异常与耗尽 jdbc 池有关 (org.apache.tomcat.jdbc.pool.PoolExhaustedException) 我们
我已经开始转换我现有的 Spring Boot(1.5.4.RELEASE) 应用程序以使用 Multi-Tenancy 功能。它是一个基于模式的 Multi-Tenancy 解决方案并且基于 mys
我是一名优秀的程序员,十分优秀!