gpt4 book ai didi

bitronix.tm.internal.XAResourceHolderState.getXAResourceHolder()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-25 18:43:05 28 4
gpt4 key购买 nike

本文整理了Java中bitronix.tm.internal.XAResourceHolderState.getXAResourceHolder()方法的一些代码示例,展示了XAResourceHolderState.getXAResourceHolder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XAResourceHolderState.getXAResourceHolder()方法的具体详情如下:
包路径:bitronix.tm.internal.XAResourceHolderState
类名称:XAResourceHolderState
方法名:getXAResourceHolder

XAResourceHolderState.getXAResourceHolder介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.btm/btm

/**
 * Remove this transaction's {@link XAResourceHolderState} from all enlisted
 * {@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates() {
  if (log.isDebugEnabled()) log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)");
  Iterator<XAResourceHolderState> it = resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState = it.next();
    XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
    // clear out the current state
    resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
    Map statesForGtrid = resourceHolder.getXAResourceHolderStatesForGtrid(gtrid);
    if (statesForGtrid != null) log.warn("resource " + resourceHolder + " did not clean up " + statesForGtrid.size() + "transaction states for GTRID [" + gtrid + "]");
    else if (log.isDebugEnabled()) log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]");
    it.remove();
  }
}

代码示例来源:origin: org.mule.btm/mule-btm

/**
 * Remove this transaction's {@link XAResourceHolderState} from all enlisted
 * {@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates() {
  if (log.isDebugEnabled()) log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)");
  Iterator<XAResourceHolderState> it = resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState = it.next();
    XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
    // clear out the current state
    resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
    Map statesForGtrid = resourceHolder.getXAResourceHolderStatesForGtrid(gtrid);
    if (statesForGtrid != null) log.warn("resource " + resourceHolder + " did not clean up " + statesForGtrid.size() + "transaction states for GTRID [" + gtrid + "]");
    else if (log.isDebugEnabled()) log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]");
    it.remove();
  }
}

代码示例来源:origin: bitronix/btm

/**
 * Remove this transaction's {@link XAResourceHolderState} from all enlisted
 * {@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates() {
  if (log.isDebugEnabled()) { log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)"); }
  Iterator<XAResourceHolderState> it = resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState = it.next();
    XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
    // clear out the current state
    resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
    boolean stillExists = resourceHolder.isExistXAResourceHolderStatesForGtrid(gtrid);
    if (stillExists) log.warn("resource " + resourceHolder + " did not clean up " + resourceHolder.getXAResourceHolderStateCountForGtrid(gtrid) + "transaction states for GTRID [" + gtrid + "]");
    else if (log.isDebugEnabled()) { log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]"); }
    it.remove();
  }
}

代码示例来源:origin: bitronix/btm

/**
 * Resume all enlisted resources in the current transaction context.
 * @throws XAException if the resource threw an exception during resume.
 */
public void resume() throws XAException {
  // all XAResource needs to be re-enlisted but this must happen
  // outside the Scheduler's iteration as enlist() can change the
  // collection's content and confuse the iterator.
  List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
  for (XAResourceHolderState xaResourceHolderState : resources) {
    if (log.isDebugEnabled()) { log.debug("resuming " + xaResourceHolderState); }
    // If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
    // re-enlisted. This must be done outside this loop or that will confuse the iterator!
    toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
  }
  if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
  for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
    if (log.isDebugEnabled()) { log.debug("re-enlisting resource " + xaResourceHolderState); }
    try {
      enlist(xaResourceHolderState);
      xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
    } catch (BitronixSystemException ex) {
      throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
    }
  }
}

代码示例来源:origin: org.mule.btm/mule-btm

/**
 * Resume all enlisted resources in the current transaction context.
 * @throws XAException if the resource threw an exception during resume.
 */
public void resume() throws XAException {
  // all XAResource needs to be re-enlisted but this must happen
  // outside the Scheduler's iteration as enlist() can change the
  // collection's content and confuse the iterator.
  List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
  for (XAResourceHolderState xaResourceHolderState : resources) {
    if (log.isDebugEnabled()) log.debug("resuming " + xaResourceHolderState);
    // If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
    // re-enlisted. This must be done outside this loop or that will confuse the iterator!
    toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
  }
  if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
  for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
    if (log.isDebugEnabled()) log.debug("re-enlisting resource " + xaResourceHolderState);
    try {
      enlist(xaResourceHolderState);
      xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
    } catch (BitronixSystemException ex) {
      throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
    }
  }
}

代码示例来源:origin: com.github.marcus-nl.btm/btm

/**
 * Resume all enlisted resources in the current transaction context.
 * @throws XAException if the resource threw an exception during resume.
 */
public void resume() throws XAException {
  // all XAResource needs to be re-enlisted but this must happen
  // outside the Scheduler's iteration as enlist() can change the
  // collection's content and confuse the iterator.
  List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
  for (XAResourceHolderState xaResourceHolderState : resources) {
    if (log.isDebugEnabled()) { log.debug("resuming " + xaResourceHolderState); }
    // If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
    // re-enlisted. This must be done outside this loop or that will confuse the iterator!
    toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
  }
  if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
  for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
    if (log.isDebugEnabled()) { log.debug("re-enlisting resource " + xaResourceHolderState); }
    try {
      enlist(xaResourceHolderState);
      xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
    } catch (BitronixSystemException ex) {
      throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
    }
  }
}

代码示例来源:origin: com.github.marcus-nl.btm/btm

/**
 * Remove this transaction's {@link XAResourceHolderState} from all enlisted
 * {@link bitronix.tm.resource.common.XAResourceHolder}s.
 */
public void clearXAResourceHolderStates() {
  if (log.isDebugEnabled()) { log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)"); }
  Iterator<XAResourceHolderState> it = resources.iterator();
  while (it.hasNext()) {
    XAResourceHolderState xaResourceHolderState = it.next();
    XAResourceHolder resourceHolder = xaResourceHolderState.getXAResourceHolder();
    // clear out the current state
    resourceHolder.removeXAResourceHolderState(xaResourceHolderState.getXid());
    boolean stillExists = resourceHolder.isExistXAResourceHolderStatesForGtrid(gtrid);
    if (stillExists) log.warn("resource " + resourceHolder + " did not clean up " + resourceHolder.getXAResourceHolderStateCountForGtrid(gtrid) + "transaction states for GTRID [" + gtrid + "]");
    else if (log.isDebugEnabled()) { log.debug("resource " + resourceHolder + " cleaned up all transaction states for GTRID [" + gtrid + "]"); }
    it.remove();
  }
}

代码示例来源:origin: org.codehaus.btm/btm

/**
 * Resume all enlisted resources in the current transaction context.
 * @throws XAException if the resource threw an exception during resume.
 */
public void resume() throws XAException {
  // all XAResource needs to be re-enlisted but this must happen
  // outside the Scheduler's iteration as enlist() can change the
  // collection's content and confuse the iterator.
  List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResourceHolderState>();
  for (XAResourceHolderState xaResourceHolderState : resources) {
    if (log.isDebugEnabled()) log.debug("resuming " + xaResourceHolderState);
    // If a prepared statement is (re-)used after suspend/resume is performed its XAResource needs to be
    // re-enlisted. This must be done outside this loop or that will confuse the iterator!
    toBeReEnlisted.add(new XAResourceHolderState(xaResourceHolderState));
  }
  if (toBeReEnlisted.size() > 0 && log.isDebugEnabled()) log.debug("re-enlisting " + toBeReEnlisted.size() + " resource(s)");
  for (XAResourceHolderState xaResourceHolderState : toBeReEnlisted) {
    if (log.isDebugEnabled()) log.debug("re-enlisting resource " + xaResourceHolderState);
    try {
      enlist(xaResourceHolderState);
      xaResourceHolderState.getXAResourceHolder().putXAResourceHolderState(xaResourceHolderState.getXid(), xaResourceHolderState);
    } catch (BitronixSystemException ex) {
      throw new BitronixXAException("error re-enlisting resource during resume: " + xaResourceHolderState, XAException.XAER_RMERR, ex);
    }
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com