问题
We're using currently c3p0 with postgresql.
Does c3p0 supports any fail-over mechanisms (no info in documentation so I assume that unfortunately no)?
I've found that mysql,oracle and ms sql supports some failover options in jdbc url, e.g. jdbcUrl="jdbc:sqlserver://mainserver:1433;failoverPartner=backupserver;
Are pgpool and pgpool-II only posibilities for postgresql?
回答1:
I don't know of any built-in failover in either the JDBC driver or the PostgreSQL core
Other options besides pgpool-II are:
- pgBouncer
- HA-JDBC (although I'm not sure how active that still is)
A complete(?) overview of all solutions is available in the Postgres wiki:
http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling
回答2:
As of Version 9.2-1000 (2012-09-27) the postgres jdbc4 drivers support failover urls (although it isn't well documented in the api) postgres jdbc Changelog
As:
jdbc:postgresql://masterHost:port,slaveHost:port/db_name
来源:https://stackoverflow.com/questions/8080050/postgresql-with-c3p0-failover