This section explains points to consider when creating applications while in database multiplexing mode.
See
Refer to the Cluster Operation Guide (Database Multiplexing) for information on database multiplexing mode.
Refer to "Application Development" in the Cluster Operation Guide (PRIMECLUSTER) for points to consider when creating applications using the failover feature integrated with the cluster software.
If an application connection switch occurs while in database multiplexing mode, explicitly close the connection and then reestablish the connection or reexecute the application.
The table below shows errors that may occur during a switch, and the corresponding action to take.
State | Error information | Action | |
---|---|---|---|
Server failure | Failure occurs during access | PGRES_FATAL_ERROR(*1) 57P01(*2) NULL(*2) | After the switch is complete, reestablish the connection, or reexecute the application. |
Accessed during system failure | CONNECTION_BAD(*3) | ||
Switch to the standby server | Switched during access | PGRES_FATAL_ERROR(*1) 57P01(*2) NULL(*2) | |
Accessed during switch | CONNECTION_BAD(*3) |
*1: Return value of PQresultStatus().
*2: Return value of PQresultErrorField() PG_DIAG_SQLSTATE.
*3: Return value of PQstatus().