Programming WebLogic Server J2EE Connectors
The following sections describe the various types of transaction levels supported by the WebLogic implementation of the J2EE Connector Architecture and explain how to specify the transaction levels in the resource adapter RAR archive.
Transactional access to EISes is an important requirement for business applications. The J2EE Connector Architecture supports the concept of transactions—a number of operations that must be committed together or not at all for the data to remain consistent and to maintain data integrity.
The WebLogic Server J2EE Connector Architecture implementation utilizes the WebLogic Server Transaction Manager implementation and supports resource adapters having the following transaction support levels (as described in the J2EE Connector Specification, Version 1.0 Final Release):
A local transaction is normally started by using the API that is specific to that resource adapter, or the CCI interface if it is supported for that adapter. When a resource adapter connection, which is configured to use Local Transaction Suport, is made and used within the context of an XA transaction, WebLogic Server automatically starts a Local Transaction to be used for this connection. When the XA transaction completes and is ready to commit, prepare is first called on the XA resources that are part of the XA transaction. Next, the Local Transaction is committed.
If the commit fails on the Local Transaction, the XA transaction and all the XA resources are rolled back. If the commit succeeds, all the XA resources for the XA transaction are committed. When an application component closes the connection, WebLogic Server cleans up the connection once the transaction has completed.
Note: Refer to the following Sun Microsystems documentation for information on the ra.xml document type definition: http://java.sun.com/dtd/connector_1_0.dtd
For more information on supported transaction levels, see the "Transaction Management" chapter in the J2EE Connector Specification, Version 1.0 Final Release (http://java.sun.com/j2ee/download.html#connectorspec).
The resource adapter specifies which kind of transaction it supports in the ra.xml deployment descriptor file provided by Sun Microsystems. For instructions on specifying the transaction level type in the RAR, refer to Configuring the Transaction Level Type in Configuration.
Note: Refer to the following Sun Microsystems documentation for information on the ra.xml document type definition: http://java.sun.com/dtd/connector_1_0.dtd
In many cases, a transaction (termed local transaction) is limited in scope to a single EIS system, and the EIS resource manager itself manages such a transaction. While an XA transaction (or global transaction) can span multiple resource managers. This form of transaction requires transaction coordination by an external transaction manager, typically bundled with an application server. A transaction manager uses a two-phase commit protocol (2PC) to manage a transaction that spans multiple resource managers (EISes). It uses one-phase commit optimization if only one resource manager is participating in an XA transaction.
The J2EE Connector Architecture defines a transaction management contract between an application server and a resource adapter (and its underlying resource manager). The transaction management contract extends the connection management contract and provides support for management of both local and XA transactions. The transaction management contract has two parts, depending on the type of transaction.
These contracts enable an application server such as WebLogic Server to provide the infrastructure and runtime environment for transaction management. Application components rely on this transaction infrastructure to support the component-level transaction model.
Because EIS implementations are so varied, the transactional support must be very flexible. The J2EE Connector Architecture imposes no requirements on the EIS for transaction management. Depending on the implementation of transactions within the EIS, a resource adapter may provide:
WebLogic Server supports all three levels of transactions, ensuring its support of EISes at different transaction levels.