0
我們使用c3p0
與Hibernate
一起使用。但是hibernate並沒有重用池中的連接。當我看到mysql-workbench
用於客戶端連接時,我可以看到其中大部分都處於「睡眠」狀態。隨着時間的推移,游泳池按照我指定的增量持續增長,直到我最終耗盡。游泳池中使用的所有連接都很困難,並建立了新連接
下面是從數據配置片斷:
persistenceMap.put(
"connection.provider_class", "org.hibernate.connection.C3P0ConnectionProvider"
);
persistenceMap.put("hibernate.c3p0.min_size", "1");
persistenceMap.put("hibernate.c3p0.max_size", "5");
persistenceMap.put("hibernate.c3p0.timeout", "5");
persistenceMap.put("hibernate.c3p0.max_statements", "20");
persistenceMap.put("hibernate.c3p0.acquire_increment", "1");
persistenceMap.put("hibernate.c3p0.maxIdleTimeExcessConnections", "3");
MYSQL - 工作臺 - >客戶端連接:
請幫助/諮詢。