BEA WebLogic Enterprise 4.2    Developer Center     

        HOME   |   SITE MAP   |   SEARCH   |   CONTACT   |   GLOSSARY  |   PDF FILES |   WHAT'S NEW 
 
        JAVA REFERENCE    |   TABLE OF CONTENTS   |   PREVIOUS TOPIC   |   NEXT TOPIC  

Transaction Service


This chapter contains the following topics:

The WebLogic Enterprise system provides the following:

This chapter describes how the WebLogic Enterprise software implements the OTS; in particular, that portion of the CORBAservices Object Transaction Service that is described as implementation-specific. This chapter provides the information that programmers need to write transactional applications for the WebLogic Enterprise system. It describes the OTS application programming interface (API) that you use to begin or terminate transactions, suspend or resume transactions, and get information about transactions.

For information about JTA, refer to the following:

Capabilities and Limitations

The following sections describe the capabilities and limitations of the Transaction Service.

Lightweight Clients with Delegated Commit

A lightweight client runs on a single-user, unmanaged desktop system that has irregular availability; that is, the owners may turn their desktop systems off when they are not in use. These single-user, unmanaged desktop systems should not be required to perform network functions like transaction coordination. In particular, unmanaged systems should not be responsible for ensuring atomicity, consistency, isolation, and durability (ACID) properties across failures for transactions involving server resources. WebLogic Enterprise remote clients are lightweight clients.

The Transaction Service allows lightweight clients to do delegated commit. Delegated commit means that the Transaction Service allows lightweight clients to begin and terminate transactions while the responsibility for transaction coordination is delegated to a transaction manager running on a server machine. The lightweight client does not need a local CORBAservices Object Transaction Service transaction manager.

Transaction Propagation

The CORBAservices Object Transaction Service specification states that a client can choose to propagate transaction context either implicitly or explicitly. This implementation of the CORBAservices Object Transaction Service provides implicit propagation. Explicit propagation is strongly discouraged.

Objects that are related to transaction context that are passed around using explicit transaction propagation should not be mixed with implicit transaction propagation APIs. It should be noted, however, that explicit propagation does not place any constraints on when transactional methods can be processed; there is no guarantee that all transactional methods will be completed before the transaction is committed.

Transaction Integrity

Checked transaction behavior provides transaction integrity by guaranteeing that a commit will not succeed unless all transactional objects involved in the transaction have completed the processing of their transactional requests. If implicit transaction propagation is used, the Transaction Service provides checked transaction behavior that is equivalent to that provided by the request/response interprocess communication models defined by The Open Group. The Transaction Service performs reply checks, commit checks, and resume checks, as described in the CORBAservices Object Transaction Service Specification.

Unchecked transaction behavior relies completely on the application to provide transaction integrity. If explicit propagation is used, the Transaction Service does not provide checked transaction behavior and transaction integrity is not guaranteed.

Transaction Termination

This implementation of the CORBAservices Object Transaction Service allows transactions to be terminated only by the client that created the transaction.

Note: The client may be a server object that requests the services of another object.

Flat Transactions

This implementation of the CORBAservices Object Transaction Service implements the flat transaction model.

Interoperability Between Remote Clients and the WebLogic Enterprise Domain

This implementation of the CORBAservices Object Transaction Service does not support remote clients invoking methods on server objects in different WebLogic Enterprise domains in the same transaction.

Remote clients with multiple connections to the same WebLogic Enterprise domain may not make invocations to server objects on these separate connections within the same transaction. An org.omg.CORBA.NO_PERMISSION standard system exception is returned to the client.

Intradomain Interoperability

The WebLogic Enterprise implementation of the CORBAservices Object Transaction Service supports native clients invoking methods on server objects in the WebLogic Enterprise domain. In addition, server objects invoking methods on other objects in the same or in different processes in the same WebLogic Enterprise domain is supported.

Network Interoperability

This implementation of the CORBAservices Object Transaction Service does not support the export or import of transactions to or from remote WebLogic Enterprise domains.

Relationship of the Transaction Service to Transaction Processing

This section describes the relationship of the Transaction Service to various transaction processing servers, interfaces, protocols, and standards, as follows:

Process Failure

The Transaction Service monitors the participants in a transaction for failures and inactivity. One of the features that distinguishes the BEA TUXEDO system from other distributed application environments is the management tools for keeping the application running when failures occur. Because the WebLogic Enterprise implementation of the CORBAservices Object Transaction Service is built upon the existing BEA TUXEDO transaction management system, it inherits the capabilities of the BEA TUXEDO system for keeping applications running.

Multithreaded Support

The WebLogic Enterprise implementation of the CORBAservices Object Transaction Service supports single-threaded implementations only. Specifically, a client with an active transaction cannot make requests for the same transaction on multiple threads. However, it is possible to have multiple transactions serially active at the same time in a single thread.

OMG Interface Definition Language (IDL)

The CORBAservices Object Transaction Service OMG IDL is described in detail in Chapter 10 of the CORBAservices: Common Object Services Specification. The WebLogic Enterprise implementation of the CORBAservices Object Transaction Service supports a functionally complete subset of the CORBAservices Object Transaction Service OMG IDL interfaces. For details, see the section "Transaction Service API" on page 7-9.

General Constraints

The following constraints apply:

Getting Initial References to the TransactionCurrent Object

To access the Transaction Service API and the extension to the Transaction Service API as described later in this chapter, an application needs to issue the following commands.

  1. Create a Bootstrap object.
    For details on creating a Bootstrap object, see
    Chapter 4, "Bootstrap Object."

  2. Invoke the resolve_initial_reference("TransactionCurrent") method on the Bootstrap object. The invocation returns a standard CORBA object pointer. For a description of this Bootstrap object method, see Chapter 4, "Bootstrap Object."

  3. If an application is interested in only the Transaction Service APIs, an org.omg.CosTransactions.Current.narrow() should be issued on the object pointer returned from step 2 above. If an application is interested in the Transaction Service APIs with the extensions, a com.beasys.Tobj.TransactionCurrent.narrow() should be issued on the object pointer returned from step 2 above.

Transaction Service API

The following sections describe the portions of the CosTransactions modules that are based on CORBA that are implemented in the WebLogic Enterprise software to support the Transaction Service. For further details, refer to Chapter 10 of the CORBAservices: Common Object Services Specification.

The definitions and interfaces supported by the Transaction Service in the WebLogic Enterprise software are as follows:

Data Types

Listing 7-1 shows the supported data types.

Listing 7-1 Data Types Supported by the Transaction Service
enum Status {
       StatusActive,
StatusMarkedRollback,
StatusPrepared,
StatusCommitted,
StatusRolledBack,
StatusUnknown,
StatusNoTransaction
StatusPreparing,
StatusCommitting,
StatusRollingBack
};

// This information is taken from CORBAservices: Common Object
// Services Specification
, p. 10-15. Revised Edition:
// March 31, 1995. Updated: March 1997. Used with permission by OMG.

Control Interface

The Control interface allows a program to explicitly manage or propagate a transaction context. An object that supports the Control interface is implicitly associated with one specific transaction.

TransactionalObject Interface

The org.omg.CosTransactions.TransactionalObject interface is used by an object to indicate that it is transactional. By supporting this interface, an object indicates that it wants the transaction context associated with the client thread to be propagated on requests to the object. However, this interface is no longer needed. For details on transaction policies that need to be set to infect objects with transactions, see the sections "Server Description File Syntax" on page 2-3 and "TransactionalObject Interface Not Enforced" on page 3-4.

The CosTransactions module defines the TransactionalObject interface (shown in Listing 7-2). The org.omg.CosTransactions.TransactionalObject interface defines no methods. It is simply a marker.

Listing 7-2 TransactionalObject Interface
interface TransactionalObject {
};
// This information is taken from CORBAservices: Common Object 
// Services Specification
, p. 10-30. Revised Edition:
// March 31, 1995. Updated: November 1997. Used with permission by // OMG.

Other CORBAservices Object Transaction Service Interfaces

All other CORBAservices Object Transaction Service interfaces are not supported. Note that the Current interface described earlier is supported only if it has been obtained from the Bootstrap object. The Control interface described earlier is supported only if it has been obtained using the get_control and the suspend methods on the Current object.

Transaction Service API Extensions

This section describes specific extensions to the COBRAservices Transaction Service API described earlier. The APIs in this section enable an application to open or close an Open Group Resource Manager.

The following APIs help facilitate participation of resource managers in a distributed transaction by allowing their two-phase commit protocol to be controlled via The Open Group XA interface.

The following definitions and interfaces are defined in the com.beasys.Tobj module.

Exception

The following exception is supported:

exception RMfailed {};

A request raises this exception to report that an attempt to open or close a resource manager failed.

TransactionCurrent Interface

This interface supports all the methods of the Current interface in the CosTransactions module as described in the Java API Reference. Additionally, this interface supports APIs to open and close the resource manager.

The Tobj module defines the TransactionCurrent interface, as shown in Listing 7-3.

Listing 7-3 TransactionCurrent Interface

Interface TransactionCurrent: CosTransactions::Current {
void open_xa_rm()
raises(RMfailed);
void close_xa_rm()
raises(Rmfailed);
}


Table 7-1 describes APIs that are specific to the resource manager. For more information about these APIs, see the Java API Reference.
Table 7-1 Resource Manager APIs for the Current Interface

Method Description

open_xa_rm

This method opens The Open Group Resource Manager to which this process is linked. A RMfailed exception is raised if there is a failure while opening the Resource Manager.

Any attempts to invoke this method by remote clients or the native clients raises a NO_IMPLEMENT standard system exception.

close_xa_rm

This method closes The Open Group Resource Manager to which this process is linked. An RMfailed exception is raised if there is a failure while closing the Resource Manager. A BAD_INV_ORDER standard system exception is raised if the function was called in an improper context (for example, the caller is in transaction mode).

Any attempts by the remote clients or the native clients to invoke this method raises a NO_IMPLEMENT standard system exception.


Copyright © 1999 BEA Systems, Inc. All Rights Reserved.
Required browser version: Netscape Communicator version 4.0 or higher, or Microsoft Internet Explorer version 4.0 or higher.
Last update: July 01, 1999.