Last Resource Commit optimization for JDBC
In theory, only databases supporting XA and providing a
javax.sql.XADataSource implementation can be used with transaction managers. In practice, there is a way around this limitation.
The Last Resource Commit optimization (sometimes referred to as Last Resource Gambit or Last Agent optimization) allows a single non-XA database to participate in a XA transaction by cleverly ordering the resources.
To enable it, you just have to create a
PoolingDataSource using the bitronix.tm.resource.jdbc.lrc.LrcXADataSource as the
Here's an example of code configuring a HSQLDB datasource:
and the same example viewed as a Resource Loader configuration