HCL OneDB transaction support for XA-compliant, external data sources
The HCL OneDB™ Transaction Manager, which is an integral part of HCL OneDB, not a separate module, recognizes XA-compliant, external data sources. These data sources can participate in two-phase commit transactions.
The transaction manager runs support routines for each XA-compliant, external data source that participates in a distributed transaction at a particular transactional event, such as prepare, commit, or rollback. This interaction conforms to X/Open XA interface standards.
- Create XA-compliant, external data source types and instances of XA-compliant, external data sources.
- Create or modify a user-defined routine (UDR), virtual table interface,
or virtual index interface to enable XA-compliant data sources to
provide data access mechanisms for external data from XA-compliant
data sources.
The MQ extension is an example of a set of UDRs that provide this type of external data access.
- Register XA-compliant, external data sources with HCL OneDB.
- Unregister XA-compliant, external data sources.
- Use multiple XA-compliant, external data sources within the same global transaction.
The transaction coordination with an XA-compliant, external data source is supported only in HCL® OneDB logged databases and ANSI-compliant databases, since these databases support transactions. Transaction coordination with an XA-compliant, external data source is not supported in non-logged databases.
Statement | Description |
---|---|
CREATE XADATASOURCE TYPE | Creates a type of XA-compliant, external data source |
CREATE XADATASOURCE | Creates an instance of an XA-compliant, external data source |
DROP XADATASOURCE | Deletes an instance of an XA-compliant, external data source |
DROP XADATASOURCE TYPE | Deletes a type of XA-compliant, external data source |
For more information about these statements, see the HCL OneDB Guide to SQL: Syntax.
The interaction between HCL OneDB and an XA-compliant, external data source occurs through a set of user-defined XA-support routines, such as xa_open, xa_end, xa_commit, and xa_prepare. You create these support routines before using the CREATE XADATASOURCE TYPE statement. For more information, see the HCL OneDB DataBlade® API Programmer's Guide.
After you create an external XA-compliant data source, you can register the data source to a current transaction and you can unregister the data source using the mi_xa_register_xadatasource() or ax_reg() and mi_xa_unregister_xadatasource() or ax_unreg() functions. In a distributed environment, you must register a data source at the local, coordinator server. Registration is transient, lasting only for the duration of the transaction. For more information about using these functions, see the HCL OneDB DataBlade API Function Reference and the HCL OneDB DataBlade API Programmer's Guide.
The onstat option | What XA-compliant data source information this command displays |
---|---|
onstat -x | Displays information about XA participants in a transaction. |
onstat -G | Displays information about XA participants in a global transaction. |
onstat -g ses session id | Displays session information, including information about XA data sources participating in a transaction. |
The HCL OneDB MQ extension provides external data access mechanisms for XA data sources.