c3p0 Java Database Pooling, failover configuration
Asked Answered
A

1

8

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.

Antependium answered 19/3, 2015 at 16:8 Comment(1)
Which database are you using? Some support failover JDBC URLs. e.g., jdbc:postgresql://masterHost:port,slaveHost:port/db_name. (Source)Atherosclerosis
A
2

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"
Antependium answered 17/6, 2015 at 14:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.