xa_start_2()--Start an XA Transaction Branch, Extended Version (Transaction Scoped Locks)


  Syntax
 #include <xa.h>

 int xa_switch.xa_start_2_entry(XID *xid,     
     int rmid, XACTL *ctl, long flags);

  Default Public Authority: *USE

  Service Program: QTNXADTP

  Threadsafe: Yes

A transaction manager calls xa_start_2() to inform a resource manager that an application may do work on behalf of a transaction branch. The calling thread becomes associated with the transaction branch.

For additional information about parameters, authorities required, return values, and error conditions, see the xa_start() API.

The xa_start_2() function is the same as the xa_start() function, with one additional parameter, ctl.

*ctl
(Input) A pointer to the following structure.
struct xactl_t {
   long flags;                       /* valid element flags */
   TRANSACTION_TIMEOUT timeout;      /* timeout value */
};

Following are the valid settings of ctl->flags.

XAOPTS_TIMEOUT: 0x00000001L Timeout value is present.

XAOPTS_NOFLAGS: 0x00000000L To be used when no optional values are set.

ctl->timeout is the number of seconds before which the resource manager can timeout and rollback the transaction. Type TRANSACTION_TIMEOUT is declared in header file xa.h.


Example

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <xa.h>

main() {
  XID   *xid;
  int   rmid;
  XACTL ctl;
  long  flags;
  int   retcode;
  extern struct xa_switch_t xa_switch;

  retcode =
     xa_switch.xa_start_2_entry(xid, rmid, &ctl, flags);
}


API introduced: V5R2

[ Back to top | UNIX-Type APIs | APIs by category ]