The propagation context is not copied to transaction current. POA neither joins the client’s transaction (T1), nor starts a server to initiate a new global transaction (T2). This is the default PMT attribute. This setting should be used for non-transactional methods to avoid the overhead of associating a current worker thread with a global transaction.
POA joins or propagates the client-initiated global transaction (T1), if the request from the client carries a global transaction context. Otherwise, POA initiates and ends a new global transaction (T2) for that request. This is the most useful PMT attribute setting for transactional methods. It ensures the business logic will always be performed with an XA connection and within a transaction. This attribute is referred as “AUTOTRAN” in classic TP products.
POA joins or propagates the client-initiated global transaction (T1), if the request from client carries a global transaction context. Otherwise, if the request is not within a CIT, the POA does not start a transaction. When combined with a null XA resource (described in “XA resources configuration”), this PMT setting is typically used for transaction propagation.
POA does not join or propagate a global transaction of a client, but always initiates and ends a new global transaction (T2) on each client request. To improve performance, use this PMT setting for all business logic with only a perform read (query) operation on backend databases.
POA always joins or propagates the global transactions of a client, if it is in a context. Otherwise, if the client did not start a transaction, POA raises an exception.
POA raises an exception if it is in a client transaction context.
EXEC SQL BEGIN DECLARE SECTION;
const char* account_id = id;
float deposit_amount = amount;
const char* conn = current->connectionName();
EXEC SQL END DECLARE SECTION;
EXEC SQL AT :conn UPDATE account_table
WHERE account_id = :account_id
SET balance = balance + :deposit_amount;
}The AT clause in the previous example is optional in some cases. For example, Oracle has the concept of default connection, which is the connection last opened by the thread-of-control. If an embedded SQL does not have the AT clause, Oracle uses the default connection. Other databases, such as Sybase, do not have the concept of default connection, and Borland recommends using the AT clause or SET CONNECTION statement with those databases.
Returns the XA resource name used by associated XA connection. See “XA resources configuration” for more information.
Returns the XID of the transaction associated with the current thread. If no transaction is associated, this method raises a CosTransactions::unavailable exception.
Returns the XA resource manager ID of the XA connection associated with the current thread. If no XA connections and no transactions are associated, this method raises a CosTransactions::Unavailable exception.
Returns the PMT attribute mode of the PMT attribute that matches or wildcard matches with the current {POA, oid, method-name} triplex. If PMT is not enabled on the POA, the return value is 0.
Returns a value 1 or 2, indicating the current thread is associated with a client or server-initiated transaction. If PMT is not enabled on the POA, the return value is 0.In VisiTransact, XA resources are also configured using an XML description named xa-resource-descriptor. An xa-resource-descriptor is the root element of an xa-resource-descriptor XML file, which typically has following structure:
Specifies a unique name for this xa-resource. This name is used by the PMT <transaction> element to decide which xa-resource the dispatched request should be associated with. The default value is default.
Specifies the library file name of the XA API library, provided by database vendor. If this attribute is left out, the engine will try to resolve the XA from the application executable module itself.
Name of the connection. This name is returned from PMT::Current::connectName() method when the connection is associated with the thread. You must ensure that this name is consistent with the name assigned in the info string.
The string passed to xa_open(). The information specified by this string is XA provider dependent. The following table shows typical setting templates:
The xa-resource’s alias name
The actual xa-resource that this alias points to.