ibm-information-center/dist/eclipse/plugins/i5OS.ic.cli_5.4.0.1/rzadpcommitrollback.htm

59 lines
3.6 KiB
HTML

<?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="Commit or roll back in a DB2 UDB CLI application" />
<meta name="DC.subject" content="commit, rollback, transaction management, SQLTransact, function, overview" />
<meta name="keywords" content="commit, rollback, transaction management, SQLTransact, function, overview" />
<meta name="DC.Relation" scheme="URI" content="rzadphdptran.htm" />
<meta name="DC.Relation" scheme="URI" content="rzadpwhentrans.htm" />
<meta name="DC.Relation" scheme="URI" content="rzadpefftrans.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1999, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzadpcommitrollback" />
<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>Commit or roll back in a DB2 UDB CLI application</title>
</head>
<body id="rzadpcommitrollback"><a name="rzadpcommitrollback"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Commit or roll back in a DB2 UDB CLI application</h1>
<div><p>The last step is to either commit or roll back the <em>transaction</em>,
using <samp class="codeph">SQLTransact()</samp>.</p>
<p>A transaction is a recoverable unit of work, or a group of SQL statements
that can be treated as one atomic operation. This means that all the operations
within the group are to be completed (committed) or undone (rolled back),
as if they were a single operation.</p>
<p>When using DB2<sup>®</sup> UDB
CLI, transactions are started implicitly with the first access to the database
using <samp class="codeph">SQLPrepare()</samp>, <samp class="codeph">SQLExecDirect()</samp> or <samp class="codeph">SQLGetTypeInfo()</samp>.
The transaction ends when you use <samp class="codeph">SQLTransact()</samp> to either
roll back or commit the transaction. This means that any SQL statements processed
between these are treated as one unit of work.</p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzadpwhentrans.htm">When to call SQLTransact() in a DB2 UDB CLI application</a></strong><br />
</li>
<li class="ulchildlink"><strong><a href="rzadpefftrans.htm">Effects of calling SQLTransact() in a DB2 UDB CLI application</a></strong><br />
</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzadphdptran.htm" title="This topic shows a typical order of function calls in a DB2 UDB CLI application.">Transaction processing task in a DB2 UDB CLI application</a></div>
</div>
</div>
</body>
</html>