错误:HikariPool-1 - 连接不可用,请求在10000ms后超时

时间:2016-06-24 22:57:47

标签: java mysql hibernate rest hikaricp

我正在开发一个API ...并且在请求了几个端点后,服务器会向我显示此消息...

WARN: SQL Error: 0, SQLState: null Jun 24, 2016 9:51:45 PM
org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions ERROR: 
HikariPool-1 - Connection is not available, request timed out after 10000ms. Jun
24, 2016 9:51:45 PM com.healthymama.utils.DEVLoggingFilter log INFO: 967 * 
Server responded with a response on thread grizzly-http-server-2

该项目是用hibernate,mysql和Hikari制作的......你能帮帮我吗?谢谢!

这里的配置:

 url = String.format("jdbc:mysql://%s:%s/%s?autoReconnect=true", host, port, bundle.getString("db.database"));

 configuration
                .setProperty("hibernate.order_updates", "true")
                .setProperty("hibernate.dialect", "org.hibernate.dialect.MySQLDialect")
                .setProperty("hibernate.hbm2ddl.auto", "update")
                .setProperty("hibernate.connection.provider_class", "com.zaxxer.hikari.hibernate.HikariConnectionProvider")
                .setProperty("hibernate.hikari.dataSourceClassName", "com.mysql.jdbc.jdbc2.optional.MysqlDataSource")
                .setProperty("hibernate.hikari.dataSource.url", url)
                .setProperty("hibernate.hikari.dataSource.user", username)
                .setProperty("hibernate.hikari.dataSource.password", password)
                .setProperty("hibernate.hikari.dataSource.cachePrepStmts", "true")
                .setProperty("hibernate.hikari.dataSource.prepStmtCacheSize", "250")
                .setProperty("hibernate.hikari.dataSource.prepStmtCacheSqlLimit", "2048")
                .setProperty("hibernate.hikari.minimumIdle", "5")
                .setProperty("hibernate.hikari.minimumIdle", "5")
                .setProperty("hibernate.hikari.maximumPoolSize", "10")
                .setProperty("hibernate.hikari.idleTimeout", "30000")
                .setProperty("hibernate.hikari.connectionTestQuery", "SELECT 1")
                .setProperty("hibernate.hikari.connectionTimeout", "10000");

0 个答案:

没有答案