I am I am testing the Fast Connection Failover(FCF) support from Oracle Universal Connection Pool (UCP) version 11.2.0.1.0. The scenario being tried out is a planned outage event. Oracle Database 11g Release 11.2.0.2.0 standard edition is the database version being used. Below are the steps I follow in my test
- Get a connection and print the instance it is connected to
- Execute "srvctl stop instance -d -n " on one of the nodes
- Execute a query on the connection retrieved in the first step.
The 3rd step fails with an error (ORA-03113: end-of-file on communication channel) when it shouldn't since it is a planned outage event. Analyzing the ucp logs I could see that the FAN event is received by the jdbc client and processed by marking the connection status as "STATUS_CLOSE_ON_RETURN" but still executing a query using that borrowed connection fails.
The expected outcome is that any queries executed on the borrowed connections succeeds and the connection still remains valid until it is returned back to the pool. It should be closed by the pool after that. The stop instance command shouldn't succeed until this is done.
Is there anything I am missing in the configuration? Is the above srvctl command correct?
The Oracle Pool Configuration is as below
PoolDataSourceImpl pds = new PoolDataSourceImpl();
try {
pds.setConnectionPoolName("Connection Pool");
pds.setConnectionFactoryClassName("oracle.jdbc.pool.OracleDataSource");
pds.setConnectionFactoryProperties(getOracleDataSourceProperties());
pds.setDataSourceName("DataSource");
pds.setServerName(SERVER_NAME);
pds.setUser("system");
pds.setPassword("pass");
pds.setPortNumber(1521);
pds.setMinPoolSize(0);
pds.setMaxPoolSize(25);
pds.setMaxIdleTime(1800);
pds.setValidateConnectionOnBorrow(true);
pds.setONSConfiguration("nodes=v-ind-db-11g-01:6200,v-ind-db-11g-02:6200");
pds.setFastConnectionFailoverEnabled(true);
pds.setInactiveConnectionTimeout(20);
pds.setConnectionWaitTimeout(20);
pds.setPropertyCycle(60);
pds.startPool();
} catch (SQLException e) {
throw new RuntimeException("Cannot create project datasource", e);
}
.......
Properties getOracleDataSourceProperties() {
Properties p = new Properties();
p.put("driverType", "oci");
p.put("networkProtocol", "tcp");
p.put("serviceName", SERVICE_NAME);
return p;
}