ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakj_5.4.0.1/rzakjimprollcmit.htm

247 lines
14 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="concept" />
<meta name="DC.Title" content="Implicit commit and rollback operations" />
<meta name="abstract" content="In some instances a commit or rollback operation is initiated by the system for a commitment definition. These types of commit and rollback operations are known as implicit commit and rollback requests." />
<meta name="description" content="In some instances a commit or rollback operation is initiated by the system for a commitment definition. These types of commit and rollback operations are known as implicit commit and rollback requests." />
<meta name="DC.Relation" scheme="URI" content="rzakjsysteminit.htm" />
<meta name="DC.Relation" scheme="URI" content="../apis/QTNCHGCO.htm" />
<meta name="DC.Relation" scheme="URI" content="rzakjabmnlend.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2004, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2004, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzakjimprollcmit" />
<meta name="DC.Language" content="en-us" />
<!-- 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. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Implicit commit and rollback operations</title>
</head>
<body id="rzakjimprollcmit"><a name="rzakjimprollcmit"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Implicit commit and rollback operations</h1>
<div><p>In some instances a commit or rollback operation is initiated by
the system for a commitment definition. These types of commit and rollback
operations are known as <em>implicit commit and rollback requests</em>. </p>
<p>Typically, a commit or rollback operation is initiated
from an application program using one of the available programming languages
that supports commitment control. These types of commit and rollback operations
are known as <em>explicit commit and rollback requests</em>.</p>
<p>The following two tables show what the system does when
certain events occur related to a commitment definition that has pending changes.
A commitment definition has pending changes if any of the following conditions
is true:</p>
<ul><li>Any committable resource has been updated.</li>
<li>A database file opened under commitment control has been read because
reading a file changes the file position.</li>
<li>The commitment definition has an API resource. Because changes to API
resources are done by a user program, the system must assume that all API
resources have pending changes.</li>
</ul>
<p>The C CM (commit operation) journal entry and C RB (rollback operation)
journal entry indicate whether the operation was explicit or implicit.</p>
<p>The following table shows the actions the system takes
when a job ends, either normally or abnormally, based on the following situations:</p>
<ul><li>The state of the transaction.</li>
<li>The action-if-end job value for the commitment definition.</li>
<li>Whether an API resource is the last agent.</li>
</ul>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" width="20%" id="d0e54">State</th>
<th valign="top" width="20%" id="d0e56">Last agent API</th>
<th valign="top" width="20%" id="d0e58">Action if Endjob<sup>1</sup> option</th>
<th valign="top" width="40%" id="d0e63">Commit or rollback operation</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="20%" headers="d0e54 ">RST</td>
<td valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">N/A</td>
<td valign="top" width="40%" headers="d0e63 ">If the commitment definition is not associated with an X/Open global
transaction, an implicit rollback is performed. <p>If the
commitment definition is associated with an X/Open global transaction, the
following events occur:</p>
<ul><li>If the transaction branch state is not Active (S1), no action is performed
and the transaction branch is left in the same state.</li>
<li>If the transaction branch state is Active (S1), an implicit rollback is
performed.</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e54 ">PIP</td>
<td valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">N/A</td>
<td valign="top" width="40%" headers="d0e63 ">If the commitment definition is not associated with an X/Open global
transaction, an implicit rollback is performed. <p>If the commitment definition
is associated with an X/Open global transaction, the transaction branch is
in the Idle (S2) state, and it is left in the Idle (S2) state.</p>
</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e54 ">PRP</td>
<td valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">WAIT</td>
<td valign="top" width="40%" headers="d0e63 ">If the commitment definition is not associated with an X/Open<sup>2</sup> global
transaction, the following occurs: <ul><li>Resynchronization is started to receive the decision from the initiator
of the commit operation.</li>
<li>The returned decision to commit or rollback is performed. It is considered
an explicit operation.</li>
</ul>
</td>
</tr>
<tr><td rowspan="2" valign="top" width="20%" headers="d0e54 ">PRP</td>
<td rowspan="2" valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">C</td>
<td valign="top" width="40%" headers="d0e63 ">If the commitment definition is not associated with an X/Open<sup>2</sup> global
transaction, an implicit commit operation is performed.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e58 ">R</td>
<td valign="top" width="40%" headers="d0e63 ">If the commitment definition is not associated with an X/Open global
transaction, an implicit rollback operation is performed. <p>If the commitment
definition is associated with an X/Open global transaction, the following
occurs:</p>
<ul><li>If the job that started the transaction ends, the transaction is left
in a prepared state until the XA TM either commits it or rolls it back. The
XA transaction branch state will be left at Prepared (S3) in this case.</li>
<li>If the SQL server job that the transaction's work is being routed to is
ended, a forced rollback is implicitly performed. The XA transaction branch
state will be changed to Heuristically Completed (S5) in this case.</li>
</ul>
</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e54 ">CIP</td>
<td valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">N/A</td>
<td valign="top" width="40%" headers="d0e63 ">An explicit commit operation is performed.</td>
</tr>
<tr><td rowspan="2" valign="top" width="20%" headers="d0e54 ">LAP</td>
<td rowspan="2" valign="top" width="20%" headers="d0e56 ">NO</td>
<td rowspan="2" valign="top" width="20%" headers="d0e58 ">WAIT</td>
<td valign="top" width="40%" headers="d0e63 ">1. Resynchronization to the last agent is used to retrieve the decision
to commit or to roll back.</td>
</tr>
<tr><td valign="top" width="40%" headers="d0e63 ">2. The returned decision to commit or to roll back is performed. It
is considered an explicit operation.</td>
</tr>
<tr><td rowspan="2" valign="top" width="20%" headers="d0e54 ">LAP</td>
<td rowspan="2" valign="top" width="20%" headers="d0e56 ">YES</td>
<td rowspan="2" valign="top" width="20%" headers="d0e58 ">WAIT</td>
<td valign="top" width="40%" headers="d0e63 ">1. The last agent API is called to retrieve the commit or rollback
decision.</td>
</tr>
<tr><td valign="top" width="40%" headers="d0e63 ">2. The commit or rollback operation is performed. It is considered
an explicit operation.</td>
</tr>
<tr><td rowspan="2" valign="top" width="20%" headers="d0e54 ">LAP</td>
<td rowspan="2" valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">C</td>
<td valign="top" width="40%" headers="d0e63 ">An implicit commit operation is performed.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e58 ">R</td>
<td valign="top" width="40%" headers="d0e63 ">An implicit rollback operation is performed.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e54 ">CMT</td>
<td valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">N/A</td>
<td valign="top" width="40%" headers="d0e63 ">A commit operation has already completed for this commitment definition
and any downstream locations. The commit operation is complete.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e54 ">VRO</td>
<td valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">N/A</td>
<td valign="top" width="40%" headers="d0e63 ">The local and remote agents voted to read-only. All downstream agents
must also have voted to read-only. No action is required.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e54 ">RBR</td>
<td valign="top" width="20%" headers="d0e56 ">N/A</td>
<td valign="top" width="20%" headers="d0e58 ">N/A</td>
<td valign="top" width="40%" headers="d0e63 ">A rollback operation is required. An explicit rollback operation is
performed.</td>
</tr>
<tr><td colspan="4" valign="top" headers="d0e54 d0e56 d0e58 d0e63 "> <div class="note"><span class="notetitle">Note:</span> <p><sup>1</sup> You can change
the <samp class="codeph">Action if Endjob</samp> option with the Change Commitment Options
(QTNCHGCO) API.</p>
<p><sup>2</sup>If the commitment definition is associated
with an X/Open global transaction, the following events occur:</p>
<ul><li>If the job that started the transaction ends, the transaction is left
in a prepared state until the XA TM either commits it or rolls it back. The
XA transaction branch state will be left at Prepared (S3) in this case.</li>
<li>For transaction-scoped locks only, if the SQL server job that the transaction's
work is being routed to is ended, a forced rollback is implicitly performed.
The XA transaction branch state will be changed to Heuristically Completed
(S5) in this case.</li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<p>The following table shows the actions the system takes when an activation
group ends and applies only to transactions with job-scoped locks. The system
actions are based on the following items:</p>
<ul><li>The state of the transaction. (It is always reset (RST) when an activation
group ends.)</li>
<li>How the activation group ends-normally or abnormally.</li>
<li>Whether an API resource is the last agent. <div class="note"><span class="notetitle">Note:</span> If an API resource is
registered as the last agent, this gives control of the commit or rollback
decision to the last agent. The result of the decision is considered an explicit
operation</div>
</li>
</ul>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" width="20%" id="d0e248">State</th>
<th valign="top" width="20%" id="d0e250">Last agent API</th>
<th valign="top" width="20%" id="d0e252">Type of end</th>
<th valign="top" width="40%" id="d0e254">Commit or rollback operation</th>
</tr>
</thead>
<tbody><tr><td valign="top" width="20%" headers="d0e248 ">RST</td>
<td valign="top" width="20%" headers="d0e250 ">No</td>
<td valign="top" width="20%" headers="d0e252 ">Normal</td>
<td valign="top" width="40%" headers="d0e254 ">An implicit commit operation is performed. If protected conversations
exist, the commitment definition will become the root initiator of the commit
operation.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e248 ">RST</td>
<td valign="top" width="20%" headers="d0e250 ">No</td>
<td valign="top" width="20%" headers="d0e252 ">Abnormal</td>
<td valign="top" width="40%" headers="d0e254 ">An implicit rollback is performed.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e248 ">RST</td>
<td valign="top" width="20%" headers="d0e250 ">Yes</td>
<td valign="top" width="20%" headers="d0e252 ">Normal</td>
<td valign="top" width="40%" headers="d0e254 ">The API exit program is called. The commit or rollback operation is
determined by the API.</td>
</tr>
<tr><td valign="top" width="20%" headers="d0e248 ">RST</td>
<td valign="top" width="20%" headers="d0e250 ">Yes</td>
<td valign="top" width="20%" headers="d0e252 ">Abnormal</td>
<td valign="top" width="40%" headers="d0e254 ">The API exit program is called. The commit or rollback operation is
determined by the API.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakjsysteminit.htm" title="The system can end commitment control, or perform an implicit commit or rollback operation. Sometimes the system-initiated end of commitment control is normal. Other times, commitment control ends with an abnormal system or job end.">System-initiated end of commitment control</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="rzakjabmnlend.htm" title="This topic applies only to commitment definitions with job-scoped locks.">Commitment control during abnormal system or job end</a></div>
</div>
<div class="relref"><strong>Related reference</strong><br />
<div><a href="../apis/QTNCHGCO.htm">Change Commitment Options (QTNCHGCO) API</a></div>
</div>
</div>
</body>
</html>