Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Oracle UCP - FCF Support - Planned Outage

Andy DufresneFeb 17 2012 — edited Feb 20 2012
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

1. Get a connection and print the instance it is connected to
2. Execute "srvctl stop instance -d <database-name> -n <node-server-name>" on one of the nodes
3. 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 succeed 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;
        }

Comments

Andy Dufresne
I was able to make this work. There were two issues with the server configuration
1. FCF doesn't work with default service. This is also stated here (in a note)
2. To simulate a planned FCF we should stop the service on a particular instance. In my initial attempt I stopped the instance which will simulate a unplanned outage.
1 - 1
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 19 2012
Added on Feb 17 2012
1 comment
297 views