protected static Set<String> collectResourcesUniqueNames(List<XAResourceHolderState> resources) { Set<String> uniqueNames = new HashSet<String>(); for (XAResourceHolderState resourceHolderState : resources) { uniqueNames.add(resourceHolderState.getUniqueName()); } return uniqueNames; }
protected static Set<String> collectResourcesUniqueNames(List<XAResourceHolderState> resources) { Set<String> uniqueNames = new HashSet<String>(); for (XAResourceHolderState resourceHolderState : resources) { uniqueNames.add(resourceHolderState.getUniqueName()); } return uniqueNames; }
protected static Set<String> collectResourcesUniqueNames(List<XAResourceHolderState> resources) { Set<String> uniqueNames = new HashSet<String>(); for (XAResourceHolderState resourceHolderState : resources) { uniqueNames.add(resourceHolderState.getUniqueName()); } return uniqueNames; }
protected static Set<String> collectResourcesUniqueNames(List<XAResourceHolderState> resources) { Set<String> uniqueNames = new HashSet<String>(); for (XAResourceHolderState resourceHolderState : resources) { uniqueNames.add(resourceHolderState.getUniqueName()); } return uniqueNames; }
/** * Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. * @return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. */ public Set<String> collectUniqueNames() { Set<String> names = new HashSet<String>(resources.size()); for (XAResourceHolderState xaResourceHolderState : resources) { names.add(xaResourceHolderState.getUniqueName()); } return Collections.unmodifiableSet(names); }
/** * Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. * @return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. */ public Set<String> collectUniqueNames() { Set<String> names = new HashSet<String>(resources.size()); for (XAResourceHolderState xaResourceHolderState : resources) { names.add(xaResourceHolderState.getUniqueName()); } return Collections.unmodifiableSet(names); }
/** * Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. * @return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. */ public Set<String> collectUniqueNames() { Set<String> names = new HashSet<String>(resources.size()); for (XAResourceHolderState xaResourceHolderState : resources) { names.add(xaResourceHolderState.getUniqueName()); } return Collections.unmodifiableSet(names); }
/** * Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. * @return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. */ public Set<String> collectUniqueNames() { Set<String> names = new HashSet<String>(resources.size()); for (XAResourceHolderState xaResourceHolderState : resources) { names.add(xaResourceHolderState.getUniqueName()); } return Collections.unmodifiableSet(names); }
/** * Create a String representation of a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. This * String will contain each resource's unique name. * @param resources a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. * @return a String representation of the list. */ public static String collectResourcesNames(Collection<XAResourceHolderState> resources) { StringBuilder sb = new StringBuilder(); sb.append("["); Iterator<XAResourceHolderState> it = resources.iterator(); while (it.hasNext()) { XAResourceHolderState resourceHolderState = it.next(); sb.append(resourceHolderState.getUniqueName()); if (it.hasNext()) sb.append(", "); } sb.append("]"); return sb.toString(); }
/** * Create a String representation of a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. This * String will contain each resource's unique name. * @param resources a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. * @return a String representation of the list. */ public static String collectResourcesNames(Collection<XAResourceHolderState> resources) { StringBuilder sb = new StringBuilder(); sb.append("["); Iterator<XAResourceHolderState> it = resources.iterator(); while (it.hasNext()) { XAResourceHolderState resourceHolderState = it.next(); sb.append(resourceHolderState.getUniqueName()); if (it.hasNext()) sb.append(", "); } sb.append("]"); return sb.toString(); }
/** * Create a String representation of a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. This * String will contain each resource's unique name. * @param resources a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. * @return a String representation of the list. */ public static String collectResourcesNames(Collection<XAResourceHolderState> resources) { StringBuilder sb = new StringBuilder(); sb.append("["); Iterator<XAResourceHolderState> it = resources.iterator(); while (it.hasNext()) { XAResourceHolderState resourceHolderState = it.next(); sb.append(resourceHolderState.getUniqueName()); if (it.hasNext()) sb.append(", "); } sb.append("]"); return sb.toString(); }
/** * Create a String representation of a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. This * String will contain each resource's unique name. * @param resources a list of {@link bitronix.tm.resource.common.XAResourceHolder}s. * @return a String representation of the list. */ public static String collectResourcesNames(Collection<XAResourceHolderState> resources) { StringBuilder sb = new StringBuilder(); sb.append("["); Iterator<XAResourceHolderState> it = resources.iterator(); while (it.hasNext()) { XAResourceHolderState resourceHolderState = it.next(); sb.append(resourceHolderState.getUniqueName()); if (it.hasNext()) sb.append(", "); } sb.append("]"); return sb.toString(); }
/** * Log exceptions that happened during a phase failure. * @param ex the phase exception. */ protected void logFailedResources(PhaseException ex) { List<Exception> exceptions = ex.getExceptions(); List<XAResourceHolderState> resources = ex.getResourceStates(); for (int i = 0; i < exceptions.size(); i++) { Exception e = exceptions.get(i); XAResourceHolderState holderState = resources.get(i); log.error("resource " + holderState.getUniqueName() + " failed on " + holderState.getXid(), e); } }
/** * Log exceptions that happened during a phase failure. * @param ex the phase exception. */ protected void logFailedResources(PhaseException ex) { List<Exception> exceptions = ex.getExceptions(); List<XAResourceHolderState> resources = ex.getResourceStates(); for (int i = 0; i < exceptions.size(); i++) { Exception e = exceptions.get(i); XAResourceHolderState holderState = resources.get(i); log.error("resource " + holderState.getUniqueName() + " failed on " + holderState.getXid(), e); } }
/** * Log exceptions that happened during a phase failure. * @param ex the phase exception. */ protected void logFailedResources(PhaseException ex) { List<Exception> exceptions = ex.getExceptions(); List<XAResourceHolderState> resources = ex.getResourceStates(); for (int i = 0; i < exceptions.size(); i++) { Exception e = exceptions.get(i); XAResourceHolderState holderState = resources.get(i); log.error("resource " + holderState.getUniqueName() + " failed on " + holderState.getXid(), e); } }
/** * Log exceptions that happened during a phase failure. * @param ex the phase exception. */ protected void logFailedResources(PhaseException ex) { List<Exception> exceptions = ex.getExceptions(); List<XAResourceHolderState> resources = ex.getResourceStates(); for (int i = 0; i < exceptions.size(); i++) { Exception e = exceptions.get(i); XAResourceHolderState holderState = resources.get(i); log.error("resource " + holderState.getUniqueName() + " failed on " + holderState.getXid(), e); } }
private void handleXAException(XAResourceHolderState failedResourceHolder, XAException xaException) throws XAException { switch (xaException.errorCode) { case XAException.XA_HEURRB: forgetHeuristicRollback(failedResourceHolder); return; case XAException.XA_HEURCOM: case XAException.XA_HEURHAZ: case XAException.XA_HEURMIX: log.error("heuristic rollback is incompatible with the global state of this transaction - guilty: " + failedResourceHolder); throw xaException; default: String extraErrorDetails = TransactionManagerServices.getExceptionAnalyzer().extractExtraXAExceptionDetails(xaException); log.warn("resource '" + failedResourceHolder.getUniqueName() + "' reported " + Decoder.decodeXAExceptionErrorCode(xaException) + " when asked to rollback transaction branch. Transaction is prepared and will rollback via recovery service when resource availability allows." + (extraErrorDetails == null ? "" : " Extra error=" + extraErrorDetails), xaException); } }
private void handleXAException(XAResourceHolderState failedResourceHolder, XAException xaException) throws XAException { switch (xaException.errorCode) { case XAException.XA_HEURRB: forgetHeuristicRollback(failedResourceHolder); return; case XAException.XA_HEURCOM: case XAException.XA_HEURHAZ: case XAException.XA_HEURMIX: log.error("heuristic rollback is incompatible with the global state of this transaction - guilty: " + failedResourceHolder); throw xaException; default: String extraErrorDetails = TransactionManagerServices.getExceptionAnalyzer().extractExtraXAExceptionDetails(xaException); log.warn("resource '" + failedResourceHolder.getUniqueName() + "' reported " + Decoder.decodeXAExceptionErrorCode(xaException) + " when asked to rollback transaction branch. Transaction is prepared and will rollback via recovery service when resource availability allows." + (extraErrorDetails == null ? "" : " Extra error=" + extraErrorDetails), xaException); } }
private void handleXAException(XAResourceHolderState failedResourceHolder, XAException xaException) throws XAException { switch (xaException.errorCode) { case XAException.XA_HEURRB: forgetHeuristicRollback(failedResourceHolder); return; case XAException.XA_HEURCOM: case XAException.XA_HEURHAZ: case XAException.XA_HEURMIX: log.error("heuristic rollback is incompatible with the global state of this transaction - guilty: " + failedResourceHolder); throw xaException; default: String extraErrorDetails = TransactionManagerServices.getExceptionAnalyzer().extractExtraXAExceptionDetails(xaException); log.warn("resource '" + failedResourceHolder.getUniqueName() + "' reported " + Decoder.decodeXAExceptionErrorCode(xaException) + " when asked to rollback transaction branch. Transaction is prepared and will rollback via recovery service when resource availability allows." + (extraErrorDetails == null ? "" : " Extra error=" + extraErrorDetails), xaException); } }
private void handleXAException(XAResourceHolderState failedResourceHolder, XAException xaException) throws XAException { switch (xaException.errorCode) { case XAException.XA_HEURRB: forgetHeuristicRollback(failedResourceHolder); return; case XAException.XA_HEURCOM: case XAException.XA_HEURHAZ: case XAException.XA_HEURMIX: log.error("heuristic rollback is incompatible with the global state of this transaction - guilty: " + failedResourceHolder); throw xaException; default: String extraErrorDetails = TransactionManagerServices.getExceptionAnalyzer().extractExtraXAExceptionDetails(xaException); log.warn("resource '" + failedResourceHolder.getUniqueName() + "' reported " + Decoder.decodeXAExceptionErrorCode(xaException) + " when asked to rollback transaction branch. Transaction is prepared and will rollback via recovery service when resource availability allows." + (extraErrorDetails == null ? "" : " Extra error=" + extraErrorDetails), xaException); } }