Implementing Transaction (JTA and JTS) Support in V3 The Approach 1. Add 2 new modules to V3/core: jta and jts 2. Use com.sun.enterprise.transaction as the top level package. 3. Use JavaEETransactionManager interface from V2 appserv-core/src/java/com/sun/enterprise and define it as @Contract (which will allow its impls to be injected as dependencies). Step 1 - Removing CORBA dependencies from the basic support 1. New class JavaEETransactionManagerSimplified class is used to implement JTA JavaEETransactionManager API for the local transaction support. It combines methods from V2 classes J2EETransactionManagerOpt (which V2 history it inherits) and J2EETransactionManagerImpl (original calls to the J2EETransactionManagerImpl methods via super() are currently either replaced with the relevant logic, or commented out, or refactored into new method calls). 2. With the appropriate modifications the following files have been moved to com.sun.enterprise.transaction:
- from appserv-core/src/java/com/sun/enterprise/distributedtx:
-
- J2EETransaction.java renamed to JavaEETransaction.java
- LocalStrings.properties
- TransactionSynchronizationRegistryImpl.java
- UserTransactionImpl.java
- from appserv-core/src/java/com/sun/enterprise/transaction:
-
- TransactionManagerHelper.java
- from appserv-commons/src/java/com/sun/enterprise/transaction
3. The interfaces under common/container-common/src/main/java/com/sun/enterprise/container/common/spi:
- Added to resolve Connector dependencies:
- ResourceHandle.java
- PoolManager.java
- Added to resolve EJB Container dependencies:
- Moved from appserv-core/src/java/com/sun/enterprise
- JavaEETransactionManager.java renamed to JavaEETransactionManager.java
Note: the above location can change if the V3 SPI rules are changed. 4. TODO List:
- Resolve creation of a JavaEETransaction instance - does it need to be replaced with HK2 related steps to allow injection?
Step 2 - Enable simplified 2-phase commit 1. Add simplified contract between JTA and internal GlassFish components that can participate in 2-phase commit. 2.Implementation to follow existing one under V2:com.sun.jts.CosTransactions package but will not use CORBA JTS API. 3. Add when necessary simplified implementation of the javax.transaction API:
-
- Transaction.java
- TransactionManager.java
- Synchronization.java
(All other javax.transaction classes and Status interface will be used from api:transaction-api) Step 3 - Adding complete JTS support
- TBD: Enable J2EETransactionManagerImpl.java style implementation
|