ibm-information-center/dist/eclipse/plugins/i5OS.ic.dbp_5.4.0.1/rbafoconcrec.htm

82 lines
6.7 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="Lock records" />
<meta name="abstract" content="DB2 Universal Database for iSeries has built-in integrity for records. For example, if PGMA reads a record for update operation, it locks that record. Another program cannot read the same record for update operation until PGMA releases the record, but another program can read the record just for inquiry." />
<meta name="description" content="DB2 Universal Database for iSeries has built-in integrity for records. For example, if PGMA reads a record for update operation, it locks that record. Another program cannot read the same record for update operation until PGMA releases the record, but another program can read the record just for inquiry." />
<meta name="DC.subject" content="record, lock, integrity, ensuring database integrity, record lock, checking, displaying, WAITRCD (Wait Record) parameter, Wait Record (WAITRCD) parameter, parameter, WAITRCD (Wait Record), Display Record Locks (DSPRCDLCK) command, DSPRCDLCK (Display Record Locks) command, command, CL, DSPRCDLCK (Display Record Locks), Display Record Locks (DSPRCDLCK), Check Record Locks (CHKRCDLCK) command, CHKRCDLCK (Check Record Locks) command, CHKRCDLCK (Check Record Locks), Check Record Locks (CHKRCDLCK), record lock" />
<meta name="keywords" content="record, lock, integrity, ensuring database integrity, record lock, checking, displaying, WAITRCD (Wait Record) parameter, Wait Record (WAITRCD) parameter, parameter, WAITRCD (Wait Record), Display Record Locks (DSPRCDLCK) command, DSPRCDLCK (Display Record Locks) command, command, CL, DSPRCDLCK (Display Record Locks), Display Record Locks (DSPRCDLCK), Check Record Locks (CHKRCDLCK) command, CHKRCDLCK (Check Record Locks) command, CHKRCDLCK (Check Record Locks), Check Record Locks (CHKRCDLCK), record lock" />
<meta name="DC.Relation" scheme="URI" content="rbafoconcc.htm" />
<meta name="DC.Relation" scheme="URI" content="../rzakj/rzakjcommitkickoff.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafodsprcdlck.htm" />
<meta name="DC.Relation" scheme="URI" content="rbafodsplckrowon.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rbafoconcrec" />
<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>Lock records</title>
</head>
<body id="rbafoconcrec"><a name="rbafoconcrec"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Lock records</h1>
<div><p>DB2
Universal Database™ for iSeries™ has built-in integrity for records. For example,
if PGMA reads a record for update operation, it locks that record. Another
program cannot read the same record for update operation until PGMA releases
the record, but another program can read the record just for inquiry.</p>
<p> In this way, the system ensures the integrity of the database. However,
you can set your own wait time for a locked record to be released using the
WAITRCD parameter.</p>
<p>The system determines the lock condition based on the type of file processing
specified in your program and the operation requested. For example, if your
open options include update or delete, each record read is locked so that
any number of users can read the record at the same time, but only one user
can update the record.</p>
<p>The system normally waits a specific number of seconds for a locked record
to be released before it sends your program a message that it cannot get the
record you are requesting. The default record wait time is 60 seconds; however,
you can set your own wait time through the WAITRCD parameter on the create
and change file commands and the override database file command. If your program
is notified that the record it wants is locked by another operation, you can
have your program take the appropriate action (for example, you can send a
message to the operator that the requested record is currently unavailable).</p>
<p>If the record lock is being implicitly acquired as a result of a referential
integrity CASCADE DELETE, SET NULL, or SET DEFAULT delete rule, the lock wait
time is limited to 30 seconds.</p>
<div class="p">The system automatically releases a lock when the locked record is updated
or deleted. However, you can release record locks without updating the record.
For information about how to release a record lock, see your high-level language
topic collection. <div class="note"><span class="notetitle">Note:</span> Using commitment control changes the record locking
rules.</div>
</div>
<p>You can display locked records using either the Display Record Locks (DSPRCDLCK)
command or iSeries Navigator.</p>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafoconcc.htm" title="By definition, all database files can be used by many users at the same time. However, some operations can lock the file, member, or data records in a member to prevent them from being shared across jobs.">Lock shared data</a></div>
</div>
<div class="relconcepts"><strong>Related concepts</strong><br />
<div><a href="../rzakj/rzakjcommitkickoff.htm">Commitment control</a></div>
<div><a href="rbafodsprcdlck.htm" title="You can also use the Display Record Locks (DSPRCDLCK) command to display the current lock status (wait or held) of records for a physical file member.">Display locked records using the Display Record Locks (DSPRCDLCK) command</a></div>
</div>
<div class="reltasks"><strong>Related tasks</strong><br />
<div><a href="rbafodsplckrowon.htm" title="Use this procedure to display locked rows using iSeries Navigator.">Display locked rows using iSeries Navigator</a></div>
</div>
</div>
</body>
</html>