public void testPrepareFailureRollbackFailure() throws Exception {
tm.begin();
tm.setTransactionTimeout(10); // TX must not timeout
Connection connection1 = poolingDataSource1.getConnection();
PooledConnectionProxy handle = (PooledConnectionProxy) connection1;
XAConnection xaConnection1 = (XAConnection) AbstractMockJdbcTest.getWrappedXAConnectionOf(handle.getPooledConnection());
connection1.createStatement();
Connection connection2 = poolingDataSource2.getConnection();
PooledConnectionProxy handle2 = (PooledConnectionProxy) connection2;
XAConnection xaConnection2 = (XAConnection) AbstractMockJdbcTest.getWrappedXAConnectionOf(handle2.getPooledConnection());
connection2.createStatement();
final MockXAResource mockXAResource1 = (MockXAResource) xaConnection1.getXAResource();
mockXAResource1.setRollbackException(createXAException("resource 1 rollback failed", XAException.XAER_INVAL));