ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaha_5.4.0.1/transactions.htm

84 lines
5.9 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="Transactions" />
<meta name="abstract" content="A transaction is a logical unit of work. To complete a logical unit of work, several actions may have to be taken against a database." />
<meta name="description" content="A transaction is a logical unit of work. To complete a logical unit of work, several actions may have to be taken against a database." />
<meta name="DC.Relation" scheme="URI" content="jdbc.htm" />
<meta name="DC.Relation" scheme="URI" content="transaut.htm" />
<meta name="DC.Relation" scheme="URI" content="transiso.htm" />
<meta name="DC.Relation" scheme="URI" content="savepnts.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="transactions" />
<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>Transactions</title>
</head>
<body id="transactions"><a name="transactions"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Transactions</h1>
<div><p>A transaction is a logical unit of work. To complete a logical
unit of work, several actions may have to be taken against a database.</p>
<p> Transactional support allows applications to ensure the following:</p>
<ul><li>All the steps to complete a logical unit of work are followed.</li>
<li>When one of the steps to the unit of work files fails, all the work done
as part of that logical unit of work can be undone and the database can return
to its previous state before the transaction began.</li>
</ul>
<p>Transactions are used to provide data integrity, correct application semantics,
and a consistent view of data during concurrent access. All Java™ Database
Connectivity (JDBC) compliant drivers must support transactions.</p>
<div class="note"><span class="notetitle">Note:</span> This section only discusses local transactions and the standard JDBC
concept of transactions. Java and the native JDBC driver support
the Java Transaction
API (JTA), distributed transactions, and the two-phase commit protocol (2PC).</div>
<p>All transactional work is handled at the Connection object level. When
the work for a transaction completes, it can be finalized by calling the commit
method. If the application aborts the transaction, the rollback method is
called.</p>
<p>All Statement objects under a connection are a part of the transaction.
This means is that if an application creates three Statement objects and uses
each object to make changes to the database, when a commit or rollback call
happens, the work for all three statements either becomes permanent or is
discarded.</p>
<p>The commit and rollback SQL statements are used to finalize transactions
when working purely with SQL. These SQL statements cannot be dynamically prepared
and you should not attempt to use them in your JDBC applications to complete
transactions.</p>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="transaut.htm">Auto-commit mode</a></strong><br />
By default, JDBC uses an operation mode called auto-commit. This means that every update to the database is immediately made permanent.</li>
<li class="ulchildlink"><strong><a href="transiso.htm">Transaction isolation levels</a></strong><br />
Transaction isolation levels specify what data is visible to statements within a transaction. These levels directly impact the level of concurrent access by defining what interaction is possible between transactions against the same target data source.</li>
<li class="ulchildlink"><strong><a href="savepnts.htm">Savepoints</a></strong><br />
Savepoints allow the setting of "staging points" in a transaction.
Savepoints are checkpoints that the application can roll back to without throwing
away the entire transaction. Savepoints are new in JDBC 3.0, meaning that
the application must run on Java Development Kit (JDK) 1.4 or a subsequent
release to use them. Moreover, savepoints are new to the Developer Kit for Java,
meaning that savepoints are not supported if JDK 1.4 or a subsequent release
is not used with previous releases of the Developer Kit for Java.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="jdbc.htm" title="The IBM Developer Kit for Java JDBC driver, also known as the &#34;native&#34; driver, provides programmatic access to iSeries database files. Using the Java Database Connectivity (JDBC) API, applications written in the Java language can access JDBC database functions with embedded Structured Query Language (SQL), run SQL statements, retrieve results, and propagate changes back to the database. The JDBC API can also be used to interact with multiple data sources in a distributed, heterogeneous environment.">Access your iSeries database with the IBM Developer Kit for Java JDBC driver</a></div>
</div>
</div>
</body>
</html>