Examples of TxInfo


Examples of com.arjuna.ats.internal.jta.xa.TxInfo

       * with it. Each element on this list also contains a list of
       * threads which have registered this resource, and what their XID
       * was for that registration.
       */

      TxInfo info = null;

      /*
       * Have we seen this specific resource instance before? Do this
       * trawl first before checking the RM instance later. Saves time.
       */

      try
      {
        synchronized (this)
        {
          info = (TxInfo) _resources.get(xaRes);

          if (info == null)
          {
            /*
             * Null info means it's not in the main resources list,
             * but may be in the duplicates.
             */

            info = (TxInfo) _duplicateResources.get(xaRes);
          }
        }

        if (info != null)
        {
          switch (info.getState())
          {
          case TxInfo.ASSOCIATION_SUSPENDED:
          {
            /*
             * Have seen resource before, so do a resume. The
             * Resource instance will still be registered with the
             * transaction though.
             */

            xaRes.start(info.xid(), XAResource.TMRESUME);

            info.setState(TxInfo.ASSOCIATED);

            synchronized (this)
            {
              _suspendCount--;
            }

            return true; // already registered resource with this
            // transaction!
          }
          case TxInfo.ASSOCIATED:
          {
            /*
             * Already active on this transaction.
             */

            return true;
          }
          case TxInfo.NOT_ASSOCIATED:
          {
            /*
             * Resource was associated, but was presumably delisted.
             */
            xaRes.start(info.xid(), XAResource.TMJOIN);

            info.setState(TxInfo.ASSOCIATED);

            return true;
          }
          default:
          {
            // Note: this exception will be caught by our catch
            // block
            throw new IllegalStateException(
                "TransactionImple.enlistResource - "
                    + jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.illegalstate")
                    + info.getState());
          }
          }
        }
      }
      catch (IllegalStateException ex)
      {
        throw ex; // we threw it in the first place
      }
      catch (XAException exp)
      {
        if (info != null)
          info.setState(TxInfo.FAILED);

        if (jtaLogger.loggerI18N.isWarnEnabled())
        {
          jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.xaerror", new Object[]
          { "TransactionImple.enlistResource", XAHelper.printXAErrorCode(exp) });
        }

        return false;
      }

      //      if (threadIsActive(xaRes))
      //    return true; // this thread has already registered a resource for
      // this db

      /*
       * We definitely haven't seen this specific resource instance
       * before, but that doesn't mean that we haven't seen the RM it is
       * connected to.
       */

      Xid xid = null;
      TxInfo existingRM = isNewRM(xaRes);

      if (existingRM == null)
      {
        /*
         * New RM, so create xid with new branch.
         */

        boolean branchRequired = true;

        synchronized (this)
        {
          if (_resources.size() == 0)// first ever, so no need for
          // branch
          {
            //branchRequired = false;
            branchRequired = true;
          }
        }

        xid = createXid(branchRequired, theModifier);

        boolean associatedWork = false;
        int retry = 20;

        /*
         * If another process has (or is about to) create the same
         * transaction association then we will probably get a failure
         * during start with XAER_DUPID. We know this must be due to
         * another server, since we keep track of our own registrations.
         * So, if this happens we create a new transaction branch and
         * try again.
         *
         * To save time we could always just create branches by default.
         *
         * Is there a benefit to a zero branch?
         */

        while (!associatedWork)
        {
          try
          {
                        if (_xaTransactionTimeoutEnabled)
                        {
                            int timeout = _theTransaction.getTimeout();

                            if (timeout > 0)
                            {
                                try
                                {
                                    xaRes.setTransactionTimeout(timeout);
                                }
                                catch (XAException te)
                                {
                                    if (jtaLogger.loggerI18N.isWarnEnabled())
                                    {
                                        jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.timeouterror", new Object[]
                                        { "TransactionImple.enlistResource", XAHelper.printXAErrorCode(te), xid });
                                    }
                                }
                            }
                        }

                        // Pay attention now, this bit is hairy. We need to add a new XAResourceRecord
                        // to the transaction, which will thereafter drive its completion. However, the transaction
                        // core is not directly XA aware, so it's our job to start the XAResource. Problem is, if
                        // adding the record fails, the tx will never end the resource via the XAResourceRecord,
                        // so we must do so directly.  start may fail due to dupl xid or other reason, and transactions
                        // may rollback async, for which reasons we can't call add before start.
                        // The xid will change on each pass of the loop, so we need to create a new record on each pass.
                        // The creation will fail in the case of multiple last resources being disallowed, in which
                        // case we don't call start on the resource at all. see JBTM-362 and JBTM-363
                        XAResourceRecord xaResourceRecord = createRecord(xaRes, params, xid);
                        if(xaResourceRecord != null) {
                            xaRes.start(xid, XAResource.TMNOFLAGS);
                            try {
                                RecoveryCoordinator recCoord = _theTransaction.registerResource(xaResourceRecord.getResource());
                                xaResourceRecord.setRecoveryCoordinator(recCoord);
                            } catch(Exception e) {
                                // we called start on the resource, but _theTransaction did not accept it.
                                // we therefore have a mess which we must now clean up by ensuring the start is undone:
                                xaResourceRecord.rollback();
                                markRollbackOnly();
                                return false;
                            }
                            _resources.put(xaRes, new TxInfo(xid));
                            return true; // dive out, no need to set associatedWork = true;
                        }

                        // if we get to here, something other than a failure of xaRes.start probably went wrong.
                        // so we don't loop and retry, we just give up.
                        markRollbackOnly();
                        return false;
          }
          catch (XAException e)
          {
            // transaction already created by another server

            /* We get this from Oracle instead of DUPID. */
            if (e.errorCode == XAException.XAER_RMERR)
            {

              if (retry > 0)
                xid = createXid(true, theModifier);

              retry--;
            }
            else
              if (e.errorCode == XAException.XAER_DUPID)
              {
                if (retry > 0)
                  xid = createXid(true, theModifier);

                retry--;
              }
              else
              {
                /*
                 * Can't do start, so set transaction to
                 * rollback only.
                 */

                if (jtaLogger.loggerI18N.isWarnEnabled())
                {
                  jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.starterror", new Object[]
                  { "TransactionImple.enlistResource - XAResource.start", XAHelper.printXAErrorCode(e), xid });
                }

                markRollbackOnly();

                throw e;
              }

            if (retry < 0)
            {
              if (jtaLogger.loggerI18N.isWarnEnabled())
              {
                jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.starterror", new Object[]
                { "TransactionImple.enlistResource - XAResource.start", XAHelper.printXAErrorCode(e), xid });
              }

              markRollbackOnly();

              throw new UNKNOWN();
            }
          }
        }
      }
      else
      {
        /*
         * Have seen this RM before, so ignore this instance. The first
         * registered RM instance will be used to drive the transaction
         * completion. We add it to the duplicateResource list so we can
         * delist it correctly later though.
         */

        /*
         * Re-create xid.
         */

        xid = existingRM.xid();

        try
        {
          xaRes.start(xid, XAResource.TMJOIN);
        }
        catch (XAException ex)
        {
          if (jtaLogger.loggerI18N.isWarnEnabled())
          {
            jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.xaerror", new Object[]
            { "TransactionImple.enlistResource - xa_start: ", XAHelper.printXAErrorCode(ex) });
          }

          markRollbackOnly();

          throw ex;
        }

        /*
         * Add to duplicate resources list so we can keep track of it
         * (particularly if we later have to delist).
         */

        _duplicateResources.put(xaRes, new TxInfo(xid));

        return true;
      }

            return false;
View Full Code Here

Examples of com.arjuna.ats.internal.jta.xa.TxInfo

       * with it. Each element on this list also contains a list of
       * threads which have registered this resource, and what their XID
       * was for that registration.
       */

      TxInfo info = null;

      /*
       * Have we seen this specific resource instance before? Do this
       * trawl first before checking the RM instance later. Saves time.
       */

      try
      {
        synchronized (this)
        {
          info = (TxInfo) _resources.get(xaRes);

          if (info == null)
          {
            /*
             * Null info means it's not in the main resources list,
             * but may be in the duplicates.
             */

            info = (TxInfo) _duplicateResources.get(xaRes);
          }
        }

        if (info != null)
        {
          switch (info.getState())
          {
          case TxInfo.ASSOCIATION_SUSPENDED:
          {
            /*
             * Have seen resource before, so do a resume. The
             * Resource instance will still be registered with the
             * transaction though.
             */

            int xaStartResume = ((theModifier == null) ? XAResource.TMRESUME
                : theModifier
                    .xaStartParameters(XAResource.TMRESUME));

            xaRes.start(info.xid(), xaStartResume);

            info.setState(TxInfo.ASSOCIATED);

            synchronized (this)
            {
              _suspendCount--;
            }

            return true; // already registered resource with this
            // transaction!
          }
          case TxInfo.ASSOCIATED:
          {
            /*
             * Already active on this transaction.
             */

            return true;
          }
          case TxInfo.NOT_ASSOCIATED:
          {
            /*
             * Resource was associated, but was presumably delisted.
             */

            int xaStartJoin = ((theModifier == null) ? XAResource.TMJOIN
                : theModifier
                    .xaStartParameters(XAResource.TMJOIN));

            xaRes.start(info.xid(), xaStartJoin);

            info.setState(TxInfo.ASSOCIATED);

            return true;
          }
          default:
          {
            // Note: this exception will be caught by our catch
            // block

            throw new IllegalStateException(
                "TransactionImple.enlistResource - "
                    + jtaLogger.logMesg
                        .getString("com.arjuna.ats.internal.jta.transaction.arjunacore.illresstate")
                    + ":" + info.getState());
          }
          }
        }
      }
      catch (IllegalStateException ex)
      {
        throw ex; // we threw it in the first place
      }
      catch (XAException exp)
      {
        if (info != null)
          info.setState(TxInfo.FAILED);

        if (jtaLogger.loggerI18N.isWarnEnabled())
        {
          jtaLogger.loggerI18N
              .warn(
                  "com.arjuna.ats.internal.jta.transaction.arjunacore.enlisterror",
                  new Object[]
                  { "TransactionImple.enlistResource",
                      XAHelper.printXAErrorCode(exp) });
        }

        return false;
      }

      // if (threadIsActive(xaRes))
      // return true; // this thread has already registered a resource for
      // this db

      /*
       * We definitely haven't seen this specific resource instance
       * before, but that doesn't mean that we haven't seen the RM it is
       * connected to.
       */

      Xid xid = null;
      TxInfo existingRM = isNewRM(xaRes);

      if (existingRM == null)
      {
        /*
         * New RM, so create xid with new branch.
         */

        boolean branchRequired = true;

        synchronized (this)
        {
          if (_resources.size() == 0)// first ever, so no need for
          // branch
          {
            // branchRequired = false;
            branchRequired = true;
          }
        }

        xid = createXid(branchRequired, theModifier);

        boolean associatedWork = false;
        int retry = 20;

        /*
         * If another process has (or is about to) create the same
         * transaction association then we will probably get a failure
         * during start with XAER_DUPID. We know this must be due to
         * another server, since we keep track of our own registrations.
         * So, if this happens we create a new transaction branch and
         * try again.
         *
         * To save time we could always just create branches by default.
         *
         * Is there a benefit to a zero branch?
         */

        while (!associatedWork)
        {
          try
          {
            if (_xaTransactionTimeoutEnabled)
            {
              int timeout = _theTransaction.getTimeout();

              if (timeout > 0)
              {
                try
                {
                  xaRes.setTransactionTimeout(timeout);
                }
                catch (XAException te)
                {
                  if (jtaLogger.loggerI18N.isWarnEnabled())
                  {
                    jtaLogger.loggerI18N
                        .warn(
                            "com.arjuna.ats.internal.jta.transaction.arjunacore.timeouterror",
                            new Object[]
                            {
                                "TransactionImple.enlistResource",
                                XAHelper
                                    .printXAErrorCode(te),
                                xid });
                  }
                }
              }
            }

            int xaStartNormal = ((theModifier == null) ? XAResource.TMNOFLAGS
                : theModifier
                    .xaStartParameters(XAResource.TMNOFLAGS));


                        // Pay attention now, this bit is hairy. We need to add a new AbstractRecord (XAResourceRecord)
                        // to the BasicAction, which will thereafter drive its completion. However, the transaction
                        // core is not directly XA aware, so it's our job to start the XAResource. Problem is, if
                        // adding the record fails, BasicAction will never end the resource via the XAResourceRecord,
                        // so we must do so directly.  start may fail due to dupl xid or other reason, and transactions
                        // may rollback async, for which reasons we can't call add before start.
                        // The xid will change on each pass of the loop, so we need to create a new record on each pass.
                        // The creation will fail in the case of multiple last resources being disallowed, in which
                        // case we don't call start on the resource at all. see JBTM-362 and JBTM-363
                        AbstractRecord abstractRecord = createRecord(xaRes, params, xid);
                        if(abstractRecord != null) {
                            xaRes.start(xid, xaStartNormal);
                            if(_theTransaction.add(abstractRecord) == AddOutcome.AR_ADDED) {
                                _resources.put(xaRes, new TxInfo(xid));
                                return true; // dive out, no need to set associatedWork = true;
                            } else {
                                // we called start on the resource, but _theTransaction did not accept it.
                                // we therefore have a mess which we must now clean up by ensuring the start is undone:
                                abstractRecord.topLevelAbort();
                            }
                        }

                        // if we get to here, something other than a failure of xaRes.start probably went wrong.
                        // so we don't loop and retry, we just give up.
                        markRollbackOnly();
                        return false;

          }
          catch (XAException e)
          {
            // transaction already created by another server

            if ((e.errorCode == XAException.XAER_DUPID)
                || (e.errorCode == XAException.XAER_RMERR))
            {
              if (retry > 0)
                xid = createXid(true, theModifier);

              retry--;
            }
            else
            {
              /*
               * Can't do start, so set transaction to rollback
               * only.
               */

              if (jtaLogger.loggerI18N.isWarnEnabled())
              {
                jtaLogger.loggerI18N
                    .warn(
                        "com.arjuna.ats.internal.jta.transaction.arjunacore.enliststarterror",
                        new Object[]
                        {
                            "TransactionImple.enlistResource",
                            XAHelper
                                .printXAErrorCode(e),
                            xid });
              }

              markRollbackOnly();

              throw e;
            }

            if (retry < 0)
            {
              if (jtaLogger.loggerI18N.isWarnEnabled())
              {
                jtaLogger.loggerI18N
                    .warn(
                        "com.arjuna.ats.internal.jta.transaction.arjunacore.enliststarterror",
                        new Object[]
                        {
                            "TransactionImple.enlistResource",
                            XAHelper
                                .printXAErrorCode(e),
                            xid });
              }

              markRollbackOnly();

              throw new javax.transaction.SystemException(
                  "TransactionImple.enlistResource - XAResource.start "
                      + jtaLogger.logMesg
                          .getString("com.arjuna.ats.internal.jta.transaction.arjunacore.couldnotregister")
                      + ": " + xid);
            }
          }
        }
      }
      else
      {
        /*
         * Have seen this RM before, so ignore this instance. The first
         * registered RM instance will be used to drive the transaction
         * completion. We add it to the duplicateResource list so we can
         * delist it correctly later though.
         */

        /*
         * Re-create xid.
         */

        xid = existingRM.xid();

        try
        {
          int xaStartJoin = ((theModifier == null) ? XAResource.TMJOIN
              : theModifier.xaStartParameters(XAResource.TMJOIN));

          xaRes.start(xid, xaStartJoin);
        }
        catch (XAException ex)
        {
          if (jtaLogger.loggerI18N.isWarnEnabled())
          {
            jtaLogger.loggerI18N
                .warn(
                    "com.arjuna.ats.internal.jta.transaction.arjunacore.xastart",
                    new Object[]
                    {
                        "TransactionImple.enlistResource - xa_start ",
                        XAHelper.printXAErrorCode(ex),
                        xid });
          }

          markRollbackOnly();

          throw ex;
        }

        /*
         * Add to duplicate resources list so we can keep track of it
         * (particularly if we later have to delist).
         */

        _duplicateResources.put(xaRes, new TxInfo(xid));

        return true;
      }

            return false;
View Full Code Here

Examples of com.arjuna.ats.internal.jta.xa.TxInfo

    default:
      throw new IllegalStateException(
          jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.inactivetx"));
    }

    TxInfo info = null;

    try
    {
      synchronized (this)
      {
        info = (TxInfo) _resources.get(xaRes);

        if (info == null)
          info = (TxInfo) _duplicateResources.get(xaRes);
      }

      if (info == null)
      {
        if (jtaLogger.loggerI18N.isWarnEnabled())
        {
          jtaLogger.loggerI18N.warn("com.arjuna.ats.internal.jta.transaction.jts.unknownres", new Object[]
          { "TransactionImple.delistResource" });
        }

        return false;
      }
      else
      {
        boolean optimizedRollback = false;

        try
        {
          /*
           * If we know the transaction is going to rollback, then we
           * can try to rollback the RM now. Just an optimisation.
           */

          if (status == javax.transaction.Status.STATUS_MARKED_ROLLBACK)
          {
            if (XAUtils.canOptimizeDelist(xaRes))
            {
              xaRes.end(info.xid(), XAResource.TMFAIL);
              xaRes.rollback(info.xid());

              info.setState(TxInfo.OPTIMIZED_ROLLBACK);

              optimizedRollback = true;
            }
          }
        }
        catch (Exception e)
        {
          // failed, so try again when transaction does rollback
        }

        switch (info.getState())
        {
        case TxInfo.ASSOCIATED:
        {
          if ((flags & XAResource.TMSUCCESS) != 0)
          {
            xaRes.end(info.xid(), XAResource.TMSUCCESS);
            info.setState(TxInfo.NOT_ASSOCIATED);
          }
          else
          {
            if ((flags & XAResource.TMSUSPEND) != 0)
            {
              xaRes.end(info.xid(), XAResource.TMSUSPEND);
              info.setState(TxInfo.ASSOCIATION_SUSPENDED);

              synchronized (this)
              {
                _suspendCount++;
              }
            }
            else
            {
              xaRes.end(info.xid(), XAResource.TMFAIL);
              info.setState(TxInfo.FAILED);
            }
          }
        }
          break;
        case TxInfo.ASSOCIATION_SUSPENDED:
        {
          if ((flags & XAResource.TMSUCCESS) != 0)
          {
            // Oracle barfs if we don't resume first, despite what
            // XA says!

            if (XAUtils.mustEndSuspendedRMs(xaRes))
              xaRes.start(info.xid(), XAResource.TMRESUME);

            xaRes.end(info.xid(), XAResource.TMSUCCESS);
            info.setState(TxInfo.NOT_ASSOCIATED);

            synchronized (this)
            {
              _suspendCount--;
            }
          }
          else
          {
            if ((flags & XAResource.TMSUSPEND) != 0)
            {
              // Note: this exception will be caught by our catch
              // block

              throw new IllegalStateException(
                  "TransactionImple.delistResource - "
                      + jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.ressusp"));
            }
            else
            {
              xaRes.end(info.xid(), XAResource.TMFAIL);
              info.setState(TxInfo.FAILED);

              synchronized (this)
              {
                _suspendCount--;
              }
            }
          }
        }
          break;
        default:
          if (!optimizedRollback)
            throw new IllegalStateException(
                "TransactionImple.delistResource - "
                    + jtaLogger.loggerI18N.getString("com.arjuna.ats.internal.jta.transaction.jts.illegalstate")
                    + info.getState());
        }

        info = null;

        return true;
      }
    }
    catch (IllegalStateException ex)
    {
      throw ex;
    }
    catch (XAException exp)
    {
      if (info != null)
        info.setState(TxInfo.FAILED);

      /*
       * For safety mark the transaction as rollback only.
       */

 
View Full Code Here

Examples of com.arjuna.ats.internal.jta.xa.TxInfo

      throw new IllegalStateException(
          jtaLogger.logMesg
              .getString("com.arjuna.ats.internal.jta.transaction.arjunacore.inactive"));
    }

    TxInfo info = null;

    try
    {
      synchronized (this)
      {
        info = (TxInfo) _resources.get(xaRes);

        if (info == null)
          info = (TxInfo) _duplicateResources.get(xaRes);
      }

      if (info == null)
      {
        if (jtaLogger.loggerI18N.isWarnEnabled())
        {
          jtaLogger.loggerI18N
              .warn(
                  "com.arjuna.ats.internal.jta.transaction.arjunacore.unknownresource",
                  new Object[]
                  { "TransactionImple.delistResource" });
        }

        return false;
      }
      else
      {
        boolean optimizedRollback = false;

        try
        {
          /*
           * If we know the transaction is going to rollback, then we
           * can try to rollback the RM now. Just an optimisation.
           */

          if (status == javax.transaction.Status.STATUS_MARKED_ROLLBACK)
          {
            if (XAUtils.canOptimizeDelist(xaRes))
            {
              xaRes.end(info.xid(), XAResource.TMFAIL);
              xaRes.rollback(info.xid());

              info.setState(TxInfo.OPTIMIZED_ROLLBACK);

              optimizedRollback = true;
            }
          }
        }
        catch (Exception e)
        {
          // failed, so try again when transaction does rollback
        }

        switch (info.getState())
        {
        case TxInfo.ASSOCIATED:
        {
          if ((flags & XAResource.TMSUCCESS) != 0)
          {
            xaRes.end(info.xid(), XAResource.TMSUCCESS);
            info.setState(TxInfo.NOT_ASSOCIATED);
          }
          else
          {
            if ((flags & XAResource.TMSUSPEND) != 0)
            {
              xaRes.end(info.xid(), XAResource.TMSUSPEND);
              info.setState(TxInfo.ASSOCIATION_SUSPENDED);

              synchronized (this)
              {
                _suspendCount++;
              }
            }
            else
            {
              xaRes.end(info.xid(), XAResource.TMFAIL);
              info.setState(TxInfo.FAILED);
            }
          }
        }
          break;
        case TxInfo.ASSOCIATION_SUSPENDED:
        {
          if ((flags & XAResource.TMSUCCESS) != 0)
          {
            // Oracle barfs if we don't send resume first, despite
            // what XA says!

            if (XAUtils.mustEndSuspendedRMs(xaRes))
              xaRes.start(info.xid(), XAResource.TMRESUME);

            xaRes.end(info.xid(), XAResource.TMSUCCESS);
            info.setState(TxInfo.NOT_ASSOCIATED);

            synchronized (this)
            {
              _suspendCount--;
            }
          }
          else
          {
            if ((flags & XAResource.TMSUSPEND) != 0)
            {
              // Note: this exception will be caught by our catch
              // block

              throw new IllegalStateException(
                  "TransactionImple.delistResource - "
                      + jtaLogger.logMesg
                          .getString("com.arjuna.ats.internal.jta.transaction.arjunacore.ressuspended"));
            }
            else
            {
              xaRes.end(info.xid(), XAResource.TMFAIL);
              info.setState(TxInfo.FAILED);

              synchronized (this)
              {
                _suspendCount--;
              }
            }
          }
        }
          break;
        default:
        {
          if (!optimizedRollback)
            throw new IllegalStateException(
                "TransactionImple.delistResource - "
                    + jtaLogger.logMesg
                        .getString("com.arjuna.ats.internal.jta.transaction.arjunacore.illresstate")
                    + ":" + info.getState());
        }
        }

        info = null;

        return true;
      }
    }
    catch (IllegalStateException ex)
    {
      throw ex;
    }
    catch (XAException exp)
    {
      if (info != null)
        info.setState(TxInfo.FAILED);

      /*
       * For safety mark the transaction as rollback only.
       */

 
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.tx.TXINFO

      fail("Expected e.getTperrno() == Connection.TPETIME");
    } catch (ConnectionException e) {
      assertTrue(e.getTperrno() == Connection.TPETIME);
    }

    TXINFO txinfo = new TXINFO();
    int inTx = TX.tx_info(txinfo);
    log.info("inTx=" + inTx);
    assertTrue(txinfo.transaction_state == TX.TX_ROLLBACK_ONLY);
    assertTrue(TX.tx_commit() == TX.TX_ROLLBACK);
  }
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.tx.TXINFO

      fail("Expected e.getTperrno() == TPEOTYPE");
    } catch (ConnectionException e) {
      assertTrue(e.getTperrno() == Connection.TPEOTYPE);
    }

    TXINFO txinfo = new TXINFO();
    int inTx = TX.tx_info(txinfo);
    log.info("inTx=" + inTx);
    assertTrue(txinfo.transaction_state == TX.TX_ROLLBACK_ONLY);
    assertTrue(TX.tx_commit() == TX.TX_ROLLBACK);
  }
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.tx.TXINFO

      assertTrue(e.getTperrno() == Connection.TPESVCFAIL);
    } catch (ConnectionException e) {
      fail("Expected e.getTperrno() == TPESVCFAIL");
    }

    TXINFO txinfo = new TXINFO();
    int inTx = TX.tx_info(txinfo);
    log.info("inTx=" + inTx);
    assertTrue(txinfo.transaction_state == TX.TX_ROLLBACK_ONLY);
    assertTrue(TX.tx_commit() == TX.TX_ROLLBACK);
  }
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.tx.TXINFO

    Session cd = connection.tpconnect(
        RunServer.getServiceNameTestRollbackOnly2(), sendbuf,
        Connection.TPSENDONLY);
    cd.tpdiscon();

    TXINFO txinfo = new TXINFO();
    int inTx = TX.tx_info(txinfo);
    log.info("inTx=" + inTx);
    assertTrue(txinfo.transaction_state == TX.TX_ROLLBACK_ONLY);
    assertTrue(TX.tx_commit() == TX.TX_ROLLBACK);
  }
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.tx.TXINFO

          "test_tprecv_TPEV_SVCFAIL_service") == 0);
    } catch (ConnectionException e) {
      fail("Expected e.getEvent() == Connection.TPEV_SVCFAIL");
    }

    TXINFO txinfo = new TXINFO();
    int inTx = TX.tx_info(txinfo);
    log.info("inTx=" + inTx);
    assertTrue(txinfo.transaction_state == TX.TX_ROLLBACK_ONLY);
    assertTrue(TX.tx_commit() == TX.TX_ROLLBACK);
  }
View Full Code Here

Examples of org.jboss.narayana.blacktie.jatmibroker.tx.TXINFO

      fail("Expected e.getTperrno() == Connection.TPESVCERR");
    } catch (ConnectionException e) {
      assertTrue(e.getTperrno() == Connection.TPESVCERR);
    }

    TXINFO txinfo = new TXINFO();
    int inTx = TX.tx_info(txinfo);
    log.info("inTx=" + inTx);
    assertTrue(txinfo.transaction_state == TX.TX_ROLLBACK_ONLY);
    assertTrue(TX.tx_commit() == TX.TX_ROLLBACK);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.