try {
rollbacker.rollback(this, interestedResources);
if (log.isDebugEnabled()) { log.debug("rollback after prepare failure succeeded"); }
} catch (Exception ex) {
// let's merge both exceptions' PhaseException to report a complete error message
PhaseException preparePhaseEx = (PhaseException) rbEx.getCause();
PhaseException rollbackPhaseEx = (PhaseException) ex.getCause();
List<Exception> exceptions = new ArrayList<Exception>();
List<XAResourceHolderState> resources = new ArrayList<XAResourceHolderState>();
exceptions.addAll(preparePhaseEx.getExceptions());
exceptions.addAll(rollbackPhaseEx.getExceptions());
resources.addAll(preparePhaseEx.getResourceStates());
resources.addAll(rollbackPhaseEx.getResourceStates());
throw new BitronixSystemException("transaction partially prepared and only partially rolled back. Some resources might be left in doubt!", new PhaseException(exceptions, resources));
}
}