Chapter 3 Understanding Transactions and Component Lifecycles
Jaguar includes CORBA Object Transaction Service (OTS) and X/Open architecture (XA) as one of its distributed transaction models. Jaguar uses the Transarc Encina® transaction coordinator to manage OTS/XA transactions. You can define components, and component methods so that the transaction coordinator automatically handles transactions (called implicit control). You can also write code in the component or client to manage transactions (called explicit control).
Jaguar does not currently support nested OTS/XA transactions (also called subtransactions). If a method attempts to create a subtransaction, the SubTransactionUnavailable exception is raised.
Two-phase commit ensures that all changes to recoverable resources (for example, multiple database servers) occur atomically, and the failure of any resource to complete causes all other resources to undo changes. Two-phase commit consists of a prepare phase and an execution phase. In the prepare phase, the transaction coordinator validates that all resources are available. In the execution phase, the transaction coordinator executes all updates to the resources.
An OTS/XA transaction coordinator uses XA resources to manage transactions. An XA resource manages information using an XA-compliant interface, for example, a database server or IBM's MQSeries® (a message queueing system). The XA interface standard is an element of the X/Open Distributed Transaction Processing (DTP) model. Currently, Sybase provides an XA-compliant interface through CT-Lib. In addition, Jaguar provides jConnect, which is a JTA (Java Transaction API)-compliant JDBC driver. See the Jaguar CTS System Administration Guide for more information about managing XA resources.
A component with the OTS-Style transaction attribute enabled follows the standard component lifecycle as described in "Component lifecycles".
Generally, OTS transactions behave in the same way as described in "Jaguar's transaction processing model". However, C++ clients as well as C++ components can explicitly start OTS transactions. When a client explicitly starts a transaction, a component method can be in the client-initiated transaction, start a new transaction, or does not have to be in any transaction at all, depending on the component transaction attribute's setting. Inappropriate transaction settings may result in runtime errors. For more information about component transaction attributes, see "Transactional component attribute". Also see "Managing explicit OTS transactions" for specific information about coding explicit OTS transactions.
You can choose OTS Style or Bean Managed for a C++ component's transaction attribute and still use the Current interface to explicitly start transactions.
Transactional calls to components on different Jaguar servers Jaguar does not support transactions that spawn over multiple Jaguar servers.
Copyright © 2000 Sybase, Inc. All rights reserved. |