Package com.caucho.transaction.xalog

Examples of com.caucho.transaction.xalog.AbstractXALogStream


      }

      if (_resourceCount > 0) {
        _status = Status.STATUS_PREPARING;

        AbstractXALogStream xaLog = _transactionManager.getXALogStream();
        boolean hasPrepare = false;
        boolean allowSinglePhase = false;

        for (int i = _resourceCount - 1; i >= 0; i--) {
          XAResource resource = (XAResource) _resources[i];

          if (i == 0 && (xaLog == null || !hasPrepare)) {
            // server/1601
            _resourceStates[0] |= RES_COMMIT;

            allowSinglePhase = true;
            break;
          }

          if ((_resourceStates[i] & RES_SHARED_RM) == 0) {
            try {
              int prepare = resource.prepare(_resourceXids[i]);

              if (prepare == XAResource.XA_RDONLY) {
              } else if (prepare == XAResource.XA_OK) {
                hasPrepare = true;
                _resourceStates[i] |= RES_COMMIT;
              } else {
                log.finer(this + " unexpected prepare result " + prepare);
                rollbackInt();
              }
            } catch (XAException e) {
              _transactionManager.addCommitResourceFail();

              heuristicExn = heuristicException(heuristicExn, e);
              rollbackInt();
              throw new RollbackExceptionWrapper(L.l("all commits rolled back"),
                                                 heuristicExn);
            }
          }
        }

        if (hasPrepare && xaLog != null) {
          _xaLog = xaLog;

          xaLog.writeTMCommit(_xid);
        }

        _status = Status.STATUS_COMMITTING;

        Exception exn = commitResources(allowSinglePhase);
View Full Code Here


    _resourceCount = 0;

    _mappedResources = null;

    AbstractXALogStream xaLog = _xaLog;
    _xaLog = null;

    if (xaLog != null) {
      try {
        xaLog.writeTMFinish(xid);
      } catch (Throwable e) {
        log.log(Level.FINER, e.toString(), e);
      }
    }
View Full Code Here

      }

      if (_resourceCount > 0) {
        _status = Status.STATUS_PREPARING;

        AbstractXALogStream xaLog = _transactionManager.getXALogStream();
        boolean hasPrepare = false;
        boolean allowSinglePhase = false;

        for (int i = _resourceCount - 1; i >= 0; i--) {
          XAResource resource = (XAResource) _resources[i];

          if (i == 0 && (xaLog == null || !hasPrepare)) {
            // server/1601
            _resourceStates[0] |= RES_COMMIT;

            allowSinglePhase = true;
            break;
          }

          if ((_resourceStates[i] & RES_SHARED_RM) == 0) {
            try {
              int prepare = resource.prepare(_resourceXids[i]);

              if (prepare == XAResource.XA_RDONLY) {
              } else if (prepare == XAResource.XA_OK) {
                hasPrepare = true;
                _resourceStates[i] |= RES_COMMIT;
              } else {
                log.finer(this + " unexpected prepare result " + prepare);
                rollbackInt();
              }
            } catch (XAException e) {
              heuristicExn = heuristicException(heuristicExn, e);
              rollbackInt();
              throw new RollbackExceptionWrapper(
                  L.l("all commits rolled back"), heuristicExn);
            }
          }
        }

        if (hasPrepare && xaLog != null) {
          _xaLog = xaLog;

          xaLog.writeTMCommit(_xid);
        }

        _status = Status.STATUS_COMMITTING;

        if (allowSinglePhase) {
View Full Code Here

   
    _resourceCount = 0;
   
    _mappedResources = null;

    AbstractXALogStream xaLog = _xaLog;
    _xaLog = null;

    if (xaLog != null) {
      try {
        xaLog.writeTMFinish(xid);
      } catch (Throwable e) {
        log.log(Level.FINER, e.toString(), e);
      }
    }
View Full Code Here

      }

      if (_resourceCount > 0) {
        _status = Status.STATUS_PREPARING;

        AbstractXALogStream xaLog = _transactionManager.getXALogStream();
        boolean hasPrepare = false;
        boolean allowSinglePhase = false;

        for (int i = _resourceCount - 1; i >= 0; i--) {
          XAResource resource = (XAResource) _resources[i];

          if (i == 0 && (xaLog == null || !hasPrepare)) {
            // server/1601
            _resourceStates[0] |= RES_COMMIT;

            allowSinglePhase = true;
            break;
          }

          if ((_resourceStates[i] & RES_SHARED_RM) == 0) {
            try {
              int prepare = resource.prepare(_resourceXids[i]);

              if (prepare == XAResource.XA_RDONLY) {
              } else if (prepare == XAResource.XA_OK) {
                hasPrepare = true;
                _resourceStates[i] |= RES_COMMIT;
              } else {
                log.finer(this + " unexpected prepare result " + prepare);
                rollbackInt();
              }
            } catch (XAException e) {
              _transactionManager.addCommitResourceFail();
             
              heuristicExn = heuristicException(heuristicExn, e);
              rollbackInt();
              throw new RollbackExceptionWrapper(L.l("all commits rolled back"),
                                                 heuristicExn);
            }
          }
        }

        if (hasPrepare && xaLog != null) {
          _xaLog = xaLog;

          xaLog.writeTMCommit(_xid);
        }

        _status = Status.STATUS_COMMITTING;

        Exception exn = commitResources(allowSinglePhase);
View Full Code Here

   
    _resourceCount = 0;
   
    _mappedResources = null;

    AbstractXALogStream xaLog = _xaLog;
    _xaLog = null;

    if (xaLog != null) {
      try {
        xaLog.writeTMFinish(xid);
      } catch (Throwable e) {
        log.log(Level.FINER, e.toString(), e);
      }
    }
View Full Code Here

TOP

Related Classes of com.caucho.transaction.xalog.AbstractXALogStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.