public void testDelistErrorAndUnilateralRollbackOnCommit() throws Exception {
btm.begin();
Connection connection1 = poolingDataSource1.getConnection();
JdbcConnectionHandle handle1 = (JdbcConnectionHandle) Proxy.getInvocationHandler(connection1);
XAConnection xaConnection1 = (XAConnection) AbstractMockJdbcTest.getWrappedXAConnectionOf(handle1.getPooledConnection());
MockXAResource xaResource1 = (MockXAResource) xaConnection1.getXAResource();
xaResource1.setEndException(new BitronixXAException("screw delistment", XAException.XAER_RMERR));
xaResource1.setRollbackException(new BitronixXAException("delistment was screwed, cannot rollback", XAException.XAER_RMERR));
connection1.createStatement(); // triggers enlistment
Connection connection2 = poolingDataSource2.getConnection();
JdbcConnectionHandle handle2 = (JdbcConnectionHandle) Proxy.getInvocationHandler(connection2);
XAConnection xaConnection2 = (XAConnection) AbstractMockJdbcTest.getWrappedXAConnectionOf(handle2.getPooledConnection());
MockXAResource xaResource2 = (MockXAResource) xaConnection2.getXAResource();
xaResource2.setEndException(new BitronixXAException("what was that transaction again?", XAException.XAER_NOTA));
xaResource2.setRollbackException(new BitronixXAException("delistment unilaterally rolled back, cannot rollback twice", XAException.XAER_RMERR));
connection2.createStatement(); // triggers enlistment