180 lines
5.6 KiB
HTML
180 lines
5.6 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
|
|
<title>ax_reg()--Exit Program to Dynamically Register an XA Resource
|
|
Manager</title>
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<!-- Begin Header Records ========================================== -->
|
|
<!-- UNIX11 SCRIPT A converted by B2H R4.1 (346) (CMS) by V2DCIJB at -->
|
|
<!-- RCHVMW2 on 1 Jun 1999 at 16:14:12 -->
|
|
<!--End Header Records -->
|
|
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
</head>
|
|
<body>
|
|
<a name="Top_Of_Page"></a>
|
|
<!-- Java sync-link -->
|
|
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
|
|
</script>
|
|
|
|
<h2>ax_reg()--Exit Program to Dynamically Register an XA Resource Manager (Job Scoped Locks)</h2>
|
|
|
|
<div class="box" style="width: 60%;">
|
|
<br>
|
|
Syntax<br>
|
|
|
|
<pre>
|
|
#include <xa.h>
|
|
|
|
int ax_reg(int <em>rmid</em>, XID <em>*xid</em>, long <em>flags</em>);
|
|
</pre>
|
|
|
|
<br>
|
|
Threadsafe: Conditional; see <a href="#USAGE">Usage Notes</a>.<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>The XA resource manager calls <strong>ax_reg()</strong> to inform a
|
|
transaction manager that it is about to do work on behalf of an application in
|
|
a thread of control. The transaction manager needs to tell the resource manager
|
|
whether or not that work should be performed on behalf of a transaction branch.
|
|
If the work is part of a transaction branch, the transaction manager will
|
|
return the transaction branch identifier in <em>*xid</em>. If the work is not
|
|
part of a transaction branch, the transaction manager will return the <strong>
|
|
NULLXID</strong> in <em>*xid</em>.</p>
|
|
|
|
<p>The XA resource manager indicates that it uses dynamic registration by
|
|
setting the <em>TMREGISTER</em> value in the <em>flags</em> element of its
|
|
<strong>xa_switch_t</strong> structure.</p>
|
|
|
|
<p>The name of the service program that contains <strong>ax_reg()</strong> and
|
|
<strong>ax_unreg()</strong> must be provided to the XA resource manager in the
|
|
<em>*xa_info</em> parameter of the <strong>db2xa_open()</strong> call.</p>
|
|
<br>
|
|
<h3>Parameters</h3>
|
|
|
|
<dl>
|
|
<dt><strong>rmid</strong></dt>
|
|
|
|
<dd>(Input) The resource manager identifier that was generated by a transaction
|
|
manager when the resource manager was opened.<br><br></dd>
|
|
|
|
<dt><strong>*xid</strong></dt>
|
|
|
|
<dd>(Input) A pointer to the buffer where the transaction manager will store
|
|
the generated transaction branch identifier. This identifier is associated with
|
|
work done in the calling thread of control or with a <strong>NULLXID</strong>,
|
|
which indicates that work is being done outside a transaction branch.</dd>
|
|
|
|
<dt><strong>flags</strong></dt>
|
|
|
|
<dd>(Input) The <em>flags</em> argument must be set to this value. <em>
|
|
TMNOFLAGS:</em> 0x00000000L No flags are defined for this function.</dd>
|
|
</dl>
|
|
<br>
|
|
<h3>Authorities</h3>
|
|
|
|
<p>None</p>
|
|
<br>
|
|
<h3>Return Value</h3>
|
|
|
|
<table cellpadding="5">
|
|
<!-- cols="15 85" -->
|
|
<tr>
|
|
<td align="left" valign="top" nowrap><em>-3</em> </td>
|
|
<td align="left" valign="top">[TMER_PROTO]
|
|
|
|
<p><strong>ax_reg()</strong> was not successful. Function was called in an
|
|
improper context.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>-2</em> </td>
|
|
<td align="left" valign="top">[TMER_INVAL]
|
|
|
|
<p><strong>ax_reg()</strong> was not successful. Incorrect arguments were
|
|
specified.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>-1</em> </td>
|
|
<td align="left" valign="top">[TMER_TMERR]
|
|
|
|
<p><strong>ax_reg()</strong> was not successful. The transaction manager
|
|
detected an error when registering the resource.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>0</em> </td>
|
|
<td align="left" valign="top">[TM_OK]
|
|
|
|
<p><strong>ax_reg()</strong> was successful.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>1</em> </td>
|
|
<td align="left" valign="top">[TM_RESUME]
|
|
|
|
<p>The resource manager should resume work on a previously suspended
|
|
transaction branch. If the resource manager does not recognize the
|
|
<em>*xid</em>, it will return a failure indication to the application.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>2</em> </td>
|
|
<td align="left" valign="top">[TM_JOIN]
|
|
|
|
<p>The resource manager is joining the work of an existing transaction branch.
|
|
If the resource manager does not recognize the <em>*xid</em>, it will return
|
|
a failure indication to the application.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<h3><a name="USAGE">Usage Notes</a></h3>
|
|
|
|
<ol>
|
|
<li>This function must be threadsafe if the transaction manager calls the XA
|
|
APIs in a multithreaded job.</li>
|
|
|
|
<li>Refer to <a href="unix12.htm#Header_3">Restrictions</a> in the introduction
|
|
to the XA APIs for restrictions when using the TM_JOIN return value.</li>
|
|
</ol>
|
|
<br>
|
|
<h3>Related Information</h3>
|
|
|
|
<ul>
|
|
<li>X/Open CAE Specification, December 1991, Distributed Transaction
|
|
Processing: The XA Specification (ISBN:1-872630-24-3, C193 or XO/CAE/91/300),
|
|
The Open Group.</li>
|
|
|
|
<li>X/Open CAE Specification, April 1995, Distributed Transaction Processing:
|
|
The TX (Transaction Demarcation) Specification (ISBN:1-85912-094-6, C504), The
|
|
Open Group.</li>
|
|
</ul>
|
|
<br>
|
|
<hr>
|
|
Exit program introduced: V4R3
|
|
<hr>
|
|
<center>
|
|
<table cellpadding="2" cellspacing="2">
|
|
<tr align="center">
|
|
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> |
|
|
<a href="unix.htm">UNIX-Type APIs</a> |
|
|
<a href="aplist.htm">APIs by category</a> </td>
|
|
</tr>
|
|
</table></center>
|
|
</body>
|
|
</html>
|
|
|