Atomikos Forum

XA DB Transaction / Two phase commit - Testing Strategy

We are using Atomikos (with XA support) integrated with Spring and Hibernate. Preliminary tests are very positive, in terms of stability and heavy load response :-)

But, I'm am facing a problem, we are delivering a solution for some customers based on two databases (Oracle/Oracle, DB2/DB2, or DB2/Oracle) for which we must guarantee the data integrity (banking solution, then accounting data are critical): I would be able to validate our implementation built on top of Atomikos.

I mean, we need to be able to prove that for example if one database is disconnected from the network (i.e. commit cannot be performed) then commit will fail on secondary database.

Is there specific tools you provide that could help to validate our implementation? (I mean to be sure we truly use Atomikos in the right way). Possibly a dummy/proxy XA JDBC driver, we can drive to simulate database failure?

Any suggestion regarding testing strategies?

Any help would be greatly appreciated.
rockhopper Send private email
Monday, March 29, 2010
Maybe this helps:

Instead of using the native XA Datasource injected to the Atomikos Datasource Bean inject a self written Wrapper.
There you can simulate such things.

Example for Postgres:

<bean id="dataSource" class="com.atomikos.jdbc.AtomikosDataSourceBean" init-method="init" destroy-method="close">
      <property name="uniqueResourceName" value="jdbc1" />
    <property name="xaDataSource" ref="postgreDS" />

<bean id="postgreDS" class="org.postgresql.PGXAWrapperDatasource" lazy-init="true">
    <property name="tcpKeepAlive" value="true" />
    <property name="user" value="${user}" />
    <property name="password" value="${password}" />
    <property name="URL" value="${url}" />

As you can see i've made a wrapper to support URL property on XADatasource Implementation from postgres. There you can overwrite getXAConnection to return your self made proxy where you can intercept calls and test db failure.
Torsten Krah Send private email
Tuesday, March 30, 2010

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics