[GLASSFISH-17022] 3.1.1 startup/deployment performance - jta.jar Created: 12/Jul/11  Updated: 12/Jul/11

Status: Open
Project: glassfish
Component/s: jts
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Hong Zhang Assignee: marina vatkina
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File v1.war    


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.

Comment by Hong Zhang [ 12/Jul/11 ]

the application used by the performance measurement

Comment by marina vatkina [ 12/Jul/11 ]

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

Comment by Hong Zhang [ 12/Jul/11 ]

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

Comment by marina vatkina [ 12/Jul/11 ]

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.

Generated at Sat Mar 28 02:25:47 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.