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

97 lines
3.0 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>db2xa_prepare()--Prepare to 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>db2xa_prepare()--Prepare to Commit an XA Transaction Branch (Job Scoped Locks)</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;xa.h&gt;
int db2xa_switch.xa_prepare_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>db2xa_prepare()</strong> to request that
a resource manager prepare for commitment any work performed on behalf of
<em>*xid</em>. The resource manager places all resources used in the
transaction branch in a state that the changes can be made permanently when it
later receives the <strong>db2xa_commit()</strong> request. All associations
for <em>*xid</em> must have been ended by calling
<strong>db2xa_end()</strong> prior to the prepare request.</p>
<p>For additional information
about parameters, authorities required, return values, and error conditions,
see the <a href="dxatlprp.htm">xa_prepare()</a> API.</p>
<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 db2xa_switch;
retcode =
db2xa_switch.xa_prepare_entry(xid, rmid, flags);
}
</pre>
<br>
<hr>
API 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>