c3p0 Java Database Pooling, failover configuration

巧了我就是萌 提交于 2020-01-14 07:51:08

问题


When a database is down then automatically the ip and port switch to another db server.

How should I configure c3p0 connection pooling of my web apps to follow this Database failover mechanism?

Currently, I am using c3p0, however in the last db failover, pool connections failed to reestablished.


回答1:


Reestablished after a failing request. Attributes that helps to come over as soon as possible

  • p:testConnectionOnCheckin="true"
  • p:preferredTestQuery="SELECT @@VERSION"
  • p:acquireRetryAttempts="10"


来源:https://stackoverflow.com/questions/29149605/c3p0-java-database-pooling-failover-configuration

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