xa_start()--Start an XA Transaction Branch (Transaction Scoped Locks)


  Syntax
 #include <xa.h>

 int xa_switch.xa_start_entry(XID *xid,     
     int rmid, long flags);

  Default Public Authority: *USE

  Service Program: QTNXADTP

  Threadsafe: Yes

A transaction manager calls xa_start() 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.


Parameters

*xid
(Input) A pointer to the transaction branch identifier for the transaction branch that is to be associated with this thread.

rmid
(Input) An integer value that the transaction manager generated when calling xa_open(). The rmid identifies the resource manager.

flags
(Input) Following are the valid settings of flags.

TMJOIN: 0x00200000L Caller is joining an existing transaction branch.

TMRESUME: 0x08000000L Caller is resuming association with a suspended transaction branch.

TMNOWAIT: 0x10000000L Do not associate the transaction branch with the thread if a blocking condition exists.

TMNOFLAGS: 0x00000000L To be used when no other flags are set.


Authorities

None


Return Value

The following return codes may be returned for any flags setting.

The following return codes indicate that TMJOIN or TMRESUME was specified, and the specified transaction branch was not associated with the thread and is marked rollback-only.



Error Messages

The following messages may be sent from this function.



Related Information


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;
  long flags;
  int  retcode;
  extern struct xa_switch_t xa_switch;

  retcode =
     xa_switch.xa_start_entry(xid, rmid, flags);
}


API introduced: V5R2

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