Configuring Informix IDS for XA
SimpleDataSourceBean example
SimpleDataSourceBean ds = new SimpleDataSourceBean();
ds.setUniqueResourceName("informix");
ds.setXaDataSourceClassName("com.informix.jdbcx.IfxXADataSource");
ds.setXaDataSourceProperties("user=informix;password=informix;serverName=ifxtest;databaseName=java;portNumber=1526;" +
"ifxIFXHOST=localhost-ifx;ifxIFX_LOCK_MODE_WAIT=5;ifxIFX_XASPEC=Y");
ds.setConnectionPoolSize(5);
Notes
Informix versions 10.00.TC3TL and 10.00.TC5I1 are known to be working both with driver version 3.00.JC3.
The database is ready for XA out of the box. There is no need to configure anything special but you have to use
create database with log for database creation or the XADataSource will refuse to connect.
Informix fully supports Transaction Multiplexing so you can if you wish enable
ExclusiveConnectionMode if you first configure your database accordingly. All tables must be configured with row-level locking and you have to update the statistics in the system catalogs that the optimizer uses to determine the lowest-cost query plan. This basically means executing these commands:
ALTER TABLE <table 1> LOCK MODE (ROW);
ALTER TABLE <table 2> LOCK MODE (ROW);
ALTER TABLE <table 3> LOCK MODE (ROW);
...
UPDATE STATISTICS HIGH;
IBM created an good article explaining how to get the most out of Informix and XA:
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0602sudhakar/index.html
--
LudovicOrban - 04 Nov 2007