Bitronix TM and UCP 11.2.0.3.0

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bitronix TM and UCP 11.2.0.3.0

chrisjr
Hi,

We are experimenting with using JTA and Tomcat 7, and with the Bitronix v2.1.4 implementation in particular. We were originally using an Oracle UCP connection pool, but then we needed to split our database into two schemas.

Bitronix is working fine with the basic OracleXADataSource, configured as documented on the website. So that's good :-). However, the "killer feature" of UCP is the Connection Failover functionality. I have therefore needed to configure Bitronix to use UCP instead. The function in my TestNG class that creates the XA DataSource is now:


import oracle.jdbc.xa.client.OracleXADataSource;
import oracle.ucp.jdbc.PoolXADataSourceImpl;

    public PoolingDataSource createXaDataSource(String uniqueName) {
        Properties properties = new Properties();
        properties.setProperty("user", DB_USER);
        properties.setProperty("password", DB_PASSWORD);
        properties.setProperty("URL", DB_URL);
        properties.setProperty("connectionFactoryClassName", OracleXADataSource.class.getCanonicalName());

        PoolingDataSource dataSource = new PoolingDataSource();
        dataSource.setClassName(PoolXADataSourceImpl.class.getCanonicalName());
        dataSource.setUniqueName(uniqueName);
        dataSource.setMaxPoolSize(POOL_SIZE);
        dataSource.setMinPoolSize(POOL_SIZE);
        dataSource.setEnableJdbc4ConnectionTest(true);
        dataSource.setShareTransactionConnections(true);
        dataSource.setDriverProperties(properties);
        return dataSource;
    }

And this *seems* to work! But I'm new to Bitronix and might have missed something... For example, I must now have *two* connection pools to configure correctly. Or will one pool's configuration override the other?

Does any of this make sense, please?

Thanks for any help here,

Cheers,
Chris
Loading...