c3p0 connection pool queries

穿精又带淫゛_ 提交于 2019-12-01 12:26:07

问题


I am using c3p0 connection pool and I have minPoolSize=1 maxPoolSize=5 and InitialPoolSize=5.

When server starts, i can see it is having 5 connection. But as the first request came, that no. increases to 10. And from then onwards it stays 10 as those 10 connections are handling that load. Now my question is, even if maxPoolSize is 5 , why it is creating another 5 conn. in the pool. Is it because of initialPoolSize ?

Thanks


回答1:


it sounds like you have two active pools. are you calling getConnection( user, password ) rather than the default getConnection()? c3p0 creates a distinct pool for each authentication. also, you can follow the number of active authentications via JMX.

initialPoolSize shouldn't have anything much to do with it. also, it's always a good idea, when trying to understand c3p0 issues, to make sure that the active config is what you expect it is. again, you can see most config parameters via JMX, or more simply, check your log files. c3p0 DataSources dump their configuration at INFO upon initialization.



来源:https://stackoverflow.com/questions/13942540/c3p0-connection-pool-queries

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!