glassfish
  1. glassfish
  2. GLASSFISH-17022

3.1.1 startup/deployment performance - jta.jar

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: jts
    • Labels:
      None

      Description

      Tom noticed the jta.jar was loaded even the JTA is not used in the application. File the issue to track this and assign to naming module for investigation.
      =============================================================================
      I noticed that container-common code (com.sun.enterprise.container.common.impl.ComponentEnvManagerImpl) injects a TransactionManager object, and this brings in the jta.jar file, even if JTA is never used in the application. Also, the FactoryForEntityManagerWrapper.create method which uses the injected TransactionManager isn't actually called during server startup.

      I don't know what thread this happens on or whether it is on the critical path for server initializaiton, but avoiding this injection might save some time.

        Activity

        Hong Zhang created issue -
        Hide
        Hong Zhang added a comment -

        the application used by the performance measurement

        Show
        Hong Zhang added a comment - the application used by the performance measurement
        Hong Zhang made changes -
        Field Original Value New Value
        Attachment v1.war [ 46656 ]
        Hide
        marina vatkina added a comment -

        jta.jar is loaded for several reasons. To change it is a redesign.

        Show
        marina vatkina added a comment - jta.jar is loaded for several reasons. To change it is a redesign.
        marina vatkina made changes -
        Issue Type Bug [ 1 ] Improvement [ 4 ]
        Assignee Cheng [ cf126330 ] marina vatkina [ mvatkina ]
        Component/s jts [ 10605 ]
        Component/s naming [ 10636 ]
        Hide
        Hong Zhang added a comment -

        marina: can you explain more about why this is by design?

        Show
        Hong Zhang added a comment - marina: can you explain more about why this is by design?
        Hide
        marina vatkina added a comment -

        1. TransactionRecoveryWrapper is a Startup service. If the recovery is enabled, it needs to be performed before the 1st tx starts (otherwise it becomes too complicated).

        2. TransactionNamingProxy registers itself with the naming manager, so that a TM, or UTx, or the newer TransactionSynchronizationRegistry can be looked up.

        3. TransactionSynchronizationRegistry also pre-registers "UserTransaction" (and this is why you probably saw the naming dependency as well). Because this name (CCC didn't allow us to drop it) doesn't have "java:" in its prefix, it needs to be pre-registered statically (i.e. at startup)

        4. Even if the user code doesn't use transactions, JavaEETransactionManager is injected into various services (why would we have @Inject otherwise?). The impl class for this interface is also in the jta.jar.

        Show
        marina vatkina added a comment - 1. TransactionRecoveryWrapper is a Startup service. If the recovery is enabled, it needs to be performed before the 1st tx starts (otherwise it becomes too complicated). 2. TransactionNamingProxy registers itself with the naming manager, so that a TM, or UTx, or the newer TransactionSynchronizationRegistry can be looked up. 3. TransactionSynchronizationRegistry also pre-registers "UserTransaction" (and this is why you probably saw the naming dependency as well). Because this name (CCC didn't allow us to drop it) doesn't have "java:" in its prefix, it needs to be pre-registered statically (i.e. at startup) 4. Even if the user code doesn't use transactions, JavaEETransactionManager is injected into various services (why would we have @Inject otherwise?). The impl class for this interface is also in the jta.jar.

          People

          • Assignee:
            marina vatkina
            Reporter:
            Hong Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: