glassfish
  1. glassfish
  2. GLASSFISH-18062

remove unnecessary inv.setTransaction call in J2EEInstanceListener

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0_b17
    • Component/s: web_container
    • Labels:
      None

      Description

      There is a summary of emails discussion:
      Sahoo: The implementation in JavaEETransactionManagerSimplified indeed calls inv.setTransaction((JavaEETransaction)tran). If this method indeed associates tx with invocation context, then there is no need for following lines of code in J2EEInstanceListener:

      // enlist resources with TM for service method
      Transaction tran;
      if ((tran = tm.getTransaction()) != null)

      { inv.setTransaction(tran); }
      before this line:
      tm.enlistComponentResources();

      Marina: the 1st thing TM does, is sets tx on the ComponentInvocation. So an extra set can be removed, though it can not be expensive:

      public void setTransaction(Object t) { this.transaction = t; }

      -----
      In this case, I will remove the following four lines of codes:
      Transaction tran;
      if ((tran = tm.getTransaction()) != null) { inv.setTransaction(tran); }

        Activity

        Hide
        Shing Wai Chan added a comment -

        fix in trunk:
        Sending src/main/java/com/sun/web/server/J2EEInstanceListener.java
        Transmitting file data .
        Committed revision 51679.

        Show
        Shing Wai Chan added a comment - fix in trunk: Sending src/main/java/com/sun/web/server/J2EEInstanceListener.java Transmitting file data . Committed revision 51679.

          People

          • Assignee:
            Shing Wai Chan
            Reporter:
            Shing Wai Chan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: