TMF Application Programmer's Guide (G06.24+)

TMF ARLIB2 Audit-Reading Procedures
HP NonStop TMF Application Programmer’s Guide—522419-004
5-12
Reading Audit Records for SQL/MX Objects
That call will return either a new audit record (if available) or an ARE-END-OF-
AUDIT message.
Reading Audit Records for SQL/MX Objects
The general steps for processing SQL/MX audit records are as follows:
1. Read the audit record (ARREAD).
2. Verify that the audit record is for an SQL/MX object (OBJECTTYPE field in
ARRECORD).
3. Obtain the before-image and after-image column format
(ARGETMXCOLUMNINFO).
4. Obtain the before image (ARFETCHMXBEFOREDATA[2]). Process the various
fields using the column information returned by ARGETMXCOLUMNINFO.
5. Obtain the after image (ARFETCHMXAFTERDATA[2]). Process the various fields
using the column information returned by ARGETMXCOLUMNINFO.
Distributed Transactions
The audit-reading procedures only allow you to read local audit trails. If your
application is performing distributed transactions, you must incorporate the audit-
reading procedures into a server that can be invoked on a remote node. You could
then receive the results either by way of messages or by creating a file on the remote
node and reading it across the network.
Tracing network transactions is somewhat difficult. At the local node, the first and only
indication that a transaction involved changes on a remote node is found in the commit
record, which contains a list of any child nodes to which it sent requests.
Because the home node is recorded in every audit record for which it is relevant, it is
fairly easy to determine the node at which the transaction was initiated. This is not
sufficient, however, to identify the node that relayed the transaction to the current node
(that is, the parent node) because other nodes might have been involved between the
home node and the current node. The network-prepared record and the commit record
list the parent node (as well as any child nodes) of the current node.
To trace a distributed transaction completely, you must have servers available on all
nodes that were involved in the transaction. In addition, you must be familiar with the
audit trails on the other nodes (at a minimum, you must know their generic names and
sequence numbers).
Figure 5-1 and Figure 5-2 show relative time lines for two distributed transactions.
Figure 5-1 shows the basic relationship between a parent node and a child node.