Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-3631

Missing branch in StdServerSession commit logic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • JBossAS-4.0.5.GA
    • JBossAS-4.0.5.CR1
    • JMS (JBossMQ)
    • None

    Description

      There is a missing branch in the StdServerSession commit logic.

      In the case where the transaction manager rollsback the transaction early,
      e.g. JBossTM does this for transaction timeouts, the status will be NO_TRANSACTION
      (or a heuristic state).

      The code:

      // Marked rollback
      if (trans.getStatus() == Status.STATUS_MARKED_ROLLBACK)
      {
      if (trace)
      log.trace(StdServerSession.this + " rolling back JMS transaction tx=" + trans);
      // actually roll it back
      tm.rollback();

      // NO XASession? then manually rollback.
      // This is not so good but
      // it's the best we can do if we have no XASession.
      if (xaSession == null && serverSessionPool.isTransacted())

      { session.rollback(); }
      }
      else if (trans.getStatus() == Status.STATUS_ACTIVE)
      {
      // Commit tx
      // This will happen if
      // a) everything goes well
      // b) app. exception was thrown
      if (trace)
      log.trace(StdServerSession.this + " commiting the JMS transaction tx=" + trans);
      tm.commit();

      // NO XASession? then manually commit. This is not so good but
      // it's the best we can do if we have no XASession.
      if (xaSession == null && serverSessionPool.isTransacted())
      { session.commit(); }
      }

      needs an extra branch:

      else
      {
      if (trace)
      log.trace(StdServerSession.this + " transaction already ended tx=" + trans);
      // spend the thread association
      tm.suspend();

      // NO XASession? then manually rollback.
      // This is not so good but
      // it's the best we can do if we have no XASession.
      if (xaSession == null && serverSessionPool.isTransacted())
      { session.rollback(); }

      }

      Attachments

        Activity

          People

            weston.price Weston M. Price (Inactive)
            adrian.brock Adrian Brock (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: