Configuring PostgreSQL for XA

AtomikosDataSourceBean example

AtomikosDataSourceBean ds = new AtomikosDataSourceBean();
ds.setUniqueResourceName("postgres");
ds.setXaDataSourceClassName("org.postgresql.xa.PGXADataSource");
Properties p = new Properties();
p.setProperty ( "user" , "java" );
p.setProperty ( "password" , "java" );
p.setProperty ( "serverName" , "localhost" );
p.setProperty ( "portNumber" , "5432" );
p.setProperty ( "databaseName" , "java" );
ds.setXaProperties ( p );
ds.setConnectionPoolSize(5);

Notes

Tested with PostgreSQL 8.2.7 and JDBC driver version 8.3-603.jdbc3

Earlier versions of the driver/DBMS are broken with respect to XA...

-- To enable XA, set the "max_prepared_transactions" parameter in postgresql.conf. Its value should be at least as large as the "max_connections" value. MichalZajac - 12 May 2008

spacer
Copyright © 2014 Atomikos BVBA. Transaction Management for Extreme Transaction Processing and SOA Environments serving ISV, Commercial, OEM and Open Source Markets
Site map RSS ATOM