249 lines
6.7 KiB
HTML
249 lines
6.7 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_recover()--Recover XA Transactions</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_recover()-- Recover XA Transaction Branches (Transaction Scoped Locks)</h2>
|
|
<div class="box" style="width: 70%;">
|
|
<br>
|
|
Syntax<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
|
|
<pre>
|
|
#include <xa.h>
|
|
|
|
int xa_switch.xa_recover_entry(XID <em>*xids</em>,
|
|
long <em>count</em>, int <em>rmid</em>, long <em>flags</em>);
|
|
</pre>
|
|
<br>
|
|
Default Public Authority: *USE<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Service Program: QTNXADTP<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
Threadsafe: Yes<br>
|
|
<!-- iddvc RMBR -->
|
|
<br>
|
|
</div>
|
|
|
|
<p>A transaction manager calls <strong>xa_recover()</strong> during recovery to
|
|
obtain a list of transaction branches that are currently in a prepared or
|
|
heuristically completed state. Multiple calls to this function can be made in a
|
|
single recovery scan. The <em>flags</em> parameter defines when a recovery
|
|
scan should start or end.</p>
|
|
|
|
<br>
|
|
|
|
|
|
<h3>Parameters</h3>
|
|
|
|
<dl>
|
|
<dt><strong>*xids</strong></dt>
|
|
|
|
<dd>(Input) A pointer to an array into which the resource manager places XIDs
|
|
for transaction branches in prepared or heuristically completed states.<br>
|
|
<br>
|
|
</dd>
|
|
|
|
<dt><strong>count</strong></dt>
|
|
|
|
<dd>(Input) The number of <em>xids</em> that fit into the <em>xids</em>
|
|
array.<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) The following are valid settings of <em>flags</em>.
|
|
<em>TMSTARTRSCAN:</em> 0x01000000L Start a recovery scan and position the
|
|
cursor to the start of the list. XIDs are returned from that point.
|
|
|
|
<p><em>TMENDRSCAN:</em> 0x00800000L End a recovery scan after returning the
|
|
XIDs. If this flag is used with the <em>TMSTARTRSCAN</em> flag, then a single
|
|
<strong>xa_recover()</strong> call starts and ends the recovery scan.</p>
|
|
|
|
<p><em>TMNOFLAGS:</em> 0x00000000L Continue a recovery scan. XIDs are
|
|
returned starting at the current cursor position.</p>
|
|
|
|
<img src="delta.gif" alt="Start of change">
|
|
<p><em>TMREGISTER:</em> 0x00000001L Return XIDs for transaction branches
|
|
in an idle state, rather than those in prepared or heuristically
|
|
completed states. This is a proprietary extension of the XA architecture
|
|
to allow a transaction manager that has failed, and is now restarting,
|
|
to recover transaction branches that were in an idle state when it failed.
|
|
If such transaction branches are not recovered, they will persist, possibly
|
|
holding locks, until an IPL of the system.
|
|
If this flag is specified when running against a heterogeneous database,
|
|
the xa_recover request will be rejected with return value XAER_INVAL.</p>
|
|
<img src="deltaend.gif" alt="End of change">
|
|
|
|
</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"><em>-6</em></td>
|
|
<td align="left" valign="top">[XAER_PROTO]
|
|
|
|
<p><strong>xa_recover()</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_recover()</strong> was not successful. Incorrect arguments were
|
|
specified.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>-3</em></td>
|
|
<td align="left" valign="top">[XAER_RMERR]
|
|
|
|
<p><strong>xa_recover()</strong> was not successful. The resource manager
|
|
detected an error determining the XIDs to return.</p>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top"><em>>= 0</em></td>
|
|
<td align="left" valign="top">The total number of XIDs returned in the
|
|
<em>xids</em> array.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<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 &1
|
|
API.</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td align="left" valign="top">CPF9872 E</td>
|
|
<td align="left" valign="top">Program or service program &1 in library
|
|
&2 ended. Reason code &3.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br>
|
|
<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 <xa.h>
|
|
|
|
main() {
|
|
XID xids[10];
|
|
int rmid;
|
|
long count=10;
|
|
long flags=TMSTARTRSCAN+TMENDRSCAN;
|
|
int retcode;
|
|
extern struct xa_switch_t xa_switch;
|
|
|
|
retcode =
|
|
xa_switch.xa_recover_entry(xids, count,
|
|
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>
|
|
|