List<XAResourceHolderState> allResources = resourceManager.getAllResources(); List<XAResourceHolderState> rolledBackResources = new ArrayList<XAResourceHolderState>(); List<XAResourceHolderState> failedResources = new ArrayList<XAResourceHolderState>();
List<XAResourceHolderState> allResources = resourceManager.getAllResources(); List<XAResourceHolderState> rolledBackResources = new ArrayList<XAResourceHolderState>(); List<XAResourceHolderState> failedResources = new ArrayList<XAResourceHolderState>();
List<XAResourceHolderState> allResources = resourceManager.getAllResources(); List<XAResourceHolderState> rolledBackResources = new ArrayList<XAResourceHolderState>(); List<XAResourceHolderState> failedResources = new ArrayList<XAResourceHolderState>();
List<XAResourceHolderState> allResources = resourceManager.getAllResources(); List<XAResourceHolderState> rolledBackResources = new ArrayList<XAResourceHolderState>(); List<XAResourceHolderState> failedResources = new ArrayList<XAResourceHolderState>();
/** * Rollback resources after a phase 1 prepare failure. All resources must be rolled back as prepared ones * are in-doubt and non-prepared ones have started/ended work done that must also be cleaned. * @param rbEx the thrown rollback exception. * @throws BitronixSystemException when a resource could not rollback prepapared state. */ private void rollbackPrepareFailure(RollbackException rbEx) throws BitronixSystemException { List<XAResourceHolderState> interestedResources = resourceManager.getAllResources(); 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)); } }
/** * Rollback resources after a phase 1 prepare failure. All resources must be rolled back as prepared ones * are in-doubt and non-prepared ones have started/ended work done that must also be cleaned. * @param rbEx the thrown rollback exception. * @throws BitronixSystemException when a resource could not rollback prepapared state. */ private void rollbackPrepareFailure(RollbackException rbEx) throws BitronixSystemException { List<XAResourceHolderState> interestedResources = resourceManager.getAllResources(); 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)); } }
/** * Rollback resources after a phase 1 prepare failure. All resources must be rolled back as prepared ones * are in-doubt and non-prepared ones have started/ended work done that must also be cleaned. * @param rbEx the thrown rollback exception. * @throws BitronixSystemException when a resource could not rollback prepapared state. */ private void rollbackPrepareFailure(RollbackException rbEx) throws BitronixSystemException { List<XAResourceHolderState> interestedResources = resourceManager.getAllResources(); 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)); } }
/** * Rollback resources after a phase 1 prepare failure. All resources must be rolled back as prepared ones * are in-doubt and non-prepared ones have started/ended work done that must also be cleaned. * @param rbEx the thrown rollback exception. * @throws BitronixSystemException when a resource could not rollback prepapared state. */ private void rollbackPrepareFailure(RollbackException rbEx) throws BitronixSystemException { List<XAResourceHolderState> interestedResources = resourceManager.getAllResources(); 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)); } }
List<XAResourceHolderState> allResources = resourceManager.getAllResources(); for (XAResourceHolderState resource : allResources) { if (!resource.isFailed())
List<XAResourceHolderState> allResources = resourceManager.getAllResources(); for (XAResourceHolderState resource : allResources) { if (!resource.isFailed())
List<XAResourceHolderState> allResources = resourceManager.getAllResources(); for (XAResourceHolderState resource : allResources) { if (!resource.isFailed())
List<XAResourceHolderState> allResources = resourceManager.getAllResources(); for (XAResourceHolderState resource : allResources) { if (!resource.isFailed())
List<XAResourceHolderState> notInterestedResources = collectNotInterestedResources(resourceManager.getAllResources(), interestedResources); rolledbackAndNotInterestedUniqueNames.addAll(collectResourcesUniqueNames(notInterestedResources));
XAResourceHolderState resourceHolder = resourceManager.getAllResources().get(0);
List<XAResourceHolderState> notInterestedResources = collectNotInterestedResources(resourceManager.getAllResources(), interestedResources); rolledbackAndNotInterestedUniqueNames.addAll(collectResourcesUniqueNames(notInterestedResources));
XAResourceHolderState resourceHolder = resourceManager.getAllResources().get(0);
List<XAResourceHolderState> notInterestedResources = collectNotInterestedResources(resourceManager.getAllResources(), interestedResources); rolledbackAndNotInterestedUniqueNames.addAll(collectResourcesUniqueNames(notInterestedResources));
List<XAResourceHolderState> notInterestedResources = collectNotInterestedResources(resourceManager.getAllResources(), interestedResources); rolledbackAndNotInterestedUniqueNames.addAll(collectResourcesUniqueNames(notInterestedResources));
XAResourceHolderState resourceHolder = resourceManager.getAllResources().get(0);
XAResourceHolderState resourceHolder = resourceManager.getAllResources().get(0);