ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/dxatlcmt.htm

372 lines
8.8 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>xa_commit()--Commit an XA Transaction Branch</title>
<!-- Begin Header Records ========================================== -->
<!-- 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- UNIX11 SCRIPT A converted by B2H R4.1 (346) (CMS) by V2DCIJB at -->
<!-- RCHVMW2 on 1 Jun 1999 at 16:14:12 -->
<!-- Edited by Kersten Feb 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>xa_commit()-- Commit an XA Transaction Branch (Transaction Scoped
Locks</h2>
<div class="box" style="width: 80%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;xa.h&gt;
int xa_switch.xa_commit_entry(XID <em>*xid</em>,
int <em>rmid</em>, long <em>flags</em>);
</pre>
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Service Program: QTNXADTP<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>A transaction manager calls <strong>xa_commit()</strong> to commit the work
associated with <em>*xid</em>. All changes that were made to resources managed
by DB2 UDB for iSeries during the transaction branch are made permanent.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>xid</strong></dt>
<dd>(Input) A pointer to the transaction branch identifier. This identifier was
generated by the transaction manager when the transaction branch was
started.<br>
<br>
</dd>
<dt><strong>rmid</strong></dt>
<dd>(Input) An integer value that the transaction manager generated when
calling <strong>xa_open()</strong>. The rmid identifies the resource
manager.<br>
<br>
</dd>
<dt><strong>flags</strong></dt>
<dd>(Input) Following are the valid settings of <em>flags</em>.
<p><em>TMNOWAIT:</em> 0x10000000L Do not commit the transaction if a blocking
condition exists.</p>
<p><em>TMONEPHASE:</em> 0x40000000L Use the one-phase commit optimization for
the specified transaction branch.</p>
<p><em>TMNOFLAGS:</em> 0x00000000L Use if no other flags are set.</p>
</dd>
</dl>
<br>
<h3>Authorities</h3>
<p>None</p>
<br>
<h3>Return Value</h3>
<p>The following values may be returned only if
<em>TMONEPHASE</em>(0x40000000L) was set in the <em>flags</em>
parameter.</p>
<table cellpadding="5">
<!-- cols="5 95" -->
<tr>
<td align="left" valign="top"><em>100</em></td>
<td align="left" valign="top">[XA_RBROLLBACK]
<p>The transaction branch was rolled back for an unspecified reason.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>101</em></td>
<td align="left" valign="top">[XA_RBCOMMFAIL]
<p>A communications failure occurred within the resource manager.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>102</em></td>
<td align="left" valign="top">[XA_RBDEADLOCK]
<p>A deadlock condition was detected within the resource manager.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>103</em></td>
<td align="left" valign="top">[XA_RBINTEGRITY]
<p>The resource manager detected a violation of the integrity of its
resources.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>104</em></td>
<td align="left" valign="top">[XA_RBOTHER]
<p>The resource manager rolled back the transaction branch for a reason not on
this list.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>105</em></td>
<td align="left" valign="top">[XA_RBPROTO]
<p>A protocol error occurred in the resource manager.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>106</em></td>
<td align="left" valign="top">[XA_RBTIMEOUT]
<p>A timeout occurred in the resource manager.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>107</em></td>
<td align="left" valign="top">[XA_RBTRANSIENT]
<p>A transient error was detected in the resource manager.</p>
</td>
</tr>
</table>
<br>
<p>The following values may be returned for all <em>flags</em> settings.</p>
<table cellpadding="5">
<!-- cols="5 95" -->
<tr>
<td align="left" valign="top"><em>-7</em></td>
<td align="left" valign="top">[XAER_RMFAIL]
<p>An error occurred that makes the resource manager unavailable.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>-6</em></td>
<td align="left" valign="top">[XAER_PROTO]
<p><strong>xa_commit()</strong> was not successful. Function was called in an
improper context.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>-5</em></td>
<td align="left" valign="top">[XAER_INVAL]
<p><strong>xa_commit()</strong> was not successful. Incorrect arguments were
specified.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>-4</em></td>
<td align="left" valign="top">[XAER_NOTA]
<p>The specified <em>xid</em> is not known by the resource manager.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>-3</em></td>
<td align="left" valign="top">[XAER_RMERR]
<p><strong>xa_commit()</strong> was not successful. The resource manager
detected an error when committing the transaction branch.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>-2</em></td>
<td align="left" valign="top">[XAER_ASYNC]
<p><strong>xa_commit()</strong> was not successful. The resource manager does
not support asynchronous operations.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top">[XA_OK]
<p><strong>xa_commit()</strong> was successful.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>4</em></td>
<td align="left" valign="top">[XA_RETRY]
<p>The resource manager is unable to commit the transaction branch at this
time. <em>TMNOWAIT</em>(0x10000000L) was set and a blocking condition exists.
All resources held on behalf of <em>*xid</em> remain in a prepared state. The
transaction manager should issue <strong>xa_commit()</strong> again at a later
time.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>5</em></td>
<td align="left" valign="top">[XA_HEURMIX]
<p>Work on the transaction branch was partially committed and partially rolled
back.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>6</em></td>
<td align="left" valign="top">[XA_HEURRB]
<p>Work on the transaction branch was heuristically rolled back.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>7</em></td>
<td align="left" valign="top">[XA_HEURCOM]
<p>Work on the transaction branch was heuristically committed.</p>
</td>
</tr>
<tr>
<td align="left" valign="top"><em>8</em></td>
<td align="left" valign="top">[XA_HEURHAZ]
<p>Work on the transaction branch may have been heuristically completed.</p>
</td>
</tr>
</table>
<br>
<h3>Error Messages</h3>
<p>The following messages may be sent from this function.</p>
<table width="100%" cellpadding="5">
<!-- cols="15 85" -->
<tr>
<th align="left" valign="top" nowrap>Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td width="15%" valign="top">CPE3418 E</td>
<td width="85%" valign="top">Possible APAR condition or hardware failure.</td>
</tr>
<tr>
<td align="left" valign="top">CPF3CF2 E</td>
<td align="left" valign="top">Error(s) occurred during running of &amp;1
API.</td>
</tr>
<tr>
<td align="left" valign="top">CPF9872 E</td>
<td align="left" valign="top">Program or service program &amp;1 in library
&amp;2 ended. Reason code &amp;3.</td>
</tr>
</table>
<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.<br>
<br>
</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>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<pre>
#include &lt;xa.h&gt;
main() {
XID *xid;
int rmid;
long flags;
int retcode;
extern struct xa_switch_t xa_switch;
retcode =
xa_switch.xa_commit_entry(xid, rmid, flags);
}
</pre>
<br>
<hr>
API introduced: V5R2
<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>