Chapter 3 Class Overview
The DB XA Module Classes
The DB XA Module provides enhancements to the existing DB Interface Module class hierarchy in the form of new implementations of some existing classes. These changes enable the use of SourcePro DB in an XA-compliant distributed transaction processing environment.
NOTE >> For information about the complete set of DB Interface Module classes, see the Chapter 3, “Class Overview,” in the DB Interface Module User’s Guide.
Database Class Enhancements
In the SourcePro DB environment, two main classes are involved in the interaction between a client and a server:
RWDBDatabase and
RWDBConnection. The DB XA Module extends these classes to make them XA-enabled. The changes in
RWDBConnection provide a bridge between the resource manager and the application programmer. Changes to
RWDBDatabase allow it to produce and manage XA-compliant
RWDBConnection objects.
The DB XA Module also enhances the functionality of class
RWDBManager to produce XA-appropriate
RWDBDatabase instances when the
propertyString passed has an
XA key.
The following criteria influenced the design of the new class and the extensions:
• The DB XA Module is an add-on to the existing DB Interface Module class library. The new classes must be transparent to any existing DB Interface Module code. Therefore, none of your existing classes or any portions of your existing code will refer to the DB XA Module implementation.
• Like the DB Interface Module, the DB XA Module follows both the producer/product paradigm and the interface/implementation design pattern.
Additional information about these classes appears in
Chapter 4 and in the
Reference Guide.
RWDBDatabase
As in the DB Interface Module, the DB XA implementation of the
RWDBDatabase class is designed around the interface/implementation design pattern. In this pattern, a common interface hides the implementation differences of different databases.
The implementation for the XA version of each access module derives from the corresponding non-XA access module. These XA-specific implementations re‑implement methods whose behavior in an XA-environment differs from that in a non-XA environment. For example, the XA-specific Oracle OCI Access Module provides an implementation class called
RWDBOCIXADatabaseImp. This class derives from the non-XA implementation class
RWDBOCIDatabaseImp, and re-implements the
connection() method to produce XA-enabled, database-specific
RWDBConnection objects.
RWDBOCIXADatabaseImp also re-implements other methods that have XA-specific behaviors.
Figure 2 illustrates the architecture of
RWDBDatabase classes.
RWDBConnection
As in the DB Interface Module, the DB XA implementation of the
RWDBConnection class is designed around the interface/implementation design pattern. In this pattern, a common interface hides the implementation differences of different database connections.
The DB XA version of each access module includes a new connection implementation class that derives from the corresponding connection implementation in the non-XA access module. For example, Oracle OCI has a new implementation class called RWDBOCIXAConnectionImp. This class derives from the non-XA implementation class RWDBOCIConnectionImp, and redefines the behavior of several methods.
Figure 3 illustrates the architecture of
RWDBConnection classes.