180 lines
12 KiB
HTML
180 lines
12 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="reference" />
|
|
<meta name="DC.Title" content="Lock states for objects" />
|
|
<meta name="abstract" content="A lock state identifies the use of the object and whether it is shared." />
|
|
<meta name="description" content="A lock state identifies the use of the object and whether it is shared." />
|
|
<meta name="DC.subject" content="object, lock state, lock state, exclusive (*EXCL), *EXCL (exclusive), exclusive (*EXCL) lock state, *EXCL (exclusive) lock state, exclusive allow read (*EXCLRD), *EXCLRD (exclusive allow read), exclusive allow read (*EXCLRD) lock state, *EXCLRD (exclusive allow read) lock state, shared-for-update (*SHRUPD), *SHRUPD (shared-for-update), *SHRUPD (shared-for-update) lock state, shared-for-update (*SHRUPD) lock state, shared-no-update (*SHRNUP), *SHRNUP (shared-no-update), *SHRNUP (shared-no-update) lock state, shared-no-update (*SHRNUP) lock state, shared-for-read (*SHRRD), *SHRRD (shared-for-read), *SHRRD (shared-for-read) lock state, shared-for-read (*SHRRD) lock state, combination table, object type table, example, changing" />
|
|
<meta name="keywords" content="object, lock state, lock state, exclusive (*EXCL), *EXCL (exclusive), exclusive (*EXCL) lock state, *EXCL (exclusive) lock state, exclusive allow read (*EXCLRD), *EXCLRD (exclusive allow read), exclusive allow read (*EXCLRD) lock state, *EXCLRD (exclusive allow read) lock state, shared-for-update (*SHRUPD), *SHRUPD (shared-for-update), *SHRUPD (shared-for-update) lock state, shared-for-update (*SHRUPD) lock state, shared-no-update (*SHRNUP), *SHRNUP (shared-no-update), *SHRNUP (shared-no-update) lock state, shared-no-update (*SHRNUP) lock state, shared-for-read (*SHRRD), *SHRRD (shared-for-read), *SHRRD (shared-for-read) lock state, shared-for-read (*SHRRD) lock state, combination table, object type table, example, changing" />
|
|
<meta name="DC.Relation" scheme="URI" content="allor.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="objlockstates" />
|
|
<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 states for objects</title>
|
|
</head>
|
|
<body id="objlockstates"><a name="objlockstates"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Lock states for objects</h1>
|
|
<div><p>A lock state identifies the use of the object and whether it is
|
|
shared.</p>
|
|
<div class="section"><p>Objects are allocated on the basis of their intended use (read
|
|
or update) and whether they can be shared (used by more than one job). The
|
|
file and member are always allocated *SHRRD and the file data is allocated
|
|
with the level of lock specified with the lock state. The five lock states
|
|
are (parameter values given in parentheses): </p>
|
|
<ul><li>Exclusive (*EXCL). The object is reserved for the exclusive use of the
|
|
requesting job; no other jobs can use the object. However, if the object
|
|
is already allocated to another job, your job cannot get exclusive use of
|
|
the object. This lock state is appropriate when a user does not want any
|
|
other user to have access to the object until the function being performed
|
|
is complete.</li>
|
|
<li>Exclusive allow read (*EXCLRD). The object is allocated to the job that
|
|
requested it, but other jobs can read the object. This lock is appropriate
|
|
when a user wants to prevent other users from performing any operation other
|
|
than a read.</li>
|
|
<li>Shared for update (*SHRUPD). The object can be shared either for update
|
|
or read with another job. That is, another user can request either a shared-for-read
|
|
lock state or a shared-for-update lock state for the same object. This lock
|
|
state is appropriate when a user intends to change an object but wants to
|
|
allow other users to read or change the same object.</li>
|
|
<li>Shared no update (*SHRNUP). The object can be shared with another job
|
|
if the job requests either a shared-no-update lock state, or a shared-for-read
|
|
lock state. This lock state is appropriate when a user does not intend to
|
|
change an object but wants to ensure that no other user changes the object.</li>
|
|
<li>Shared for read (*SHRRD). The object can be shared with another job if
|
|
the user does not request exclusive use of the object. That is, another user
|
|
can request an exclusive-allow-read, shared-for-update, shared-for-read, or
|
|
shared-no-update lock state.</li>
|
|
</ul>
|
|
<div class="note"><span class="notetitle">Note:</span> The allocation of a library does not restrict the operations that
|
|
can be performed on the objects within the library. That is, if one job places
|
|
an exclusive-allow-read or shared-for-update lock state on a library, other
|
|
jobs can no longer place objects in or remove objects from the library; however,
|
|
the other jobs can still update objects within the library.</div>
|
|
<p>The following
|
|
table shows the valid lock state combinations for an object:</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><caption>Table 1. Valid Lock State Combinations</caption><thead align="left"><tr><th align="left" valign="bottom" width="43.41372912801484%" id="d0e117">If One Job Obtains This Lock State:</th>
|
|
<th align="left" valign="bottom" width="56.58627087198516%" id="d0e119">Another Job Can Obtain This Lock State:</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="left" valign="top" width="43.41372912801484%" headers="d0e117 ">*EXCL</td>
|
|
<td align="left" valign="top" width="56.58627087198516%" headers="d0e119 ">None</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="43.41372912801484%" headers="d0e117 ">*EXCLRD</td>
|
|
<td align="left" valign="top" width="56.58627087198516%" headers="d0e119 ">*SHRRD</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="43.41372912801484%" headers="d0e117 ">*SHRUPD</td>
|
|
<td align="left" valign="top" width="56.58627087198516%" headers="d0e119 ">*SHRUPD or *SHRRD</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="43.41372912801484%" headers="d0e117 ">*SHRNUP</td>
|
|
<td align="left" valign="top" width="56.58627087198516%" headers="d0e119 ">*SHRNUP or *SHRRD</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="43.41372912801484%" headers="d0e117 ">*SHRRD</td>
|
|
<td align="left" valign="top" width="56.58627087198516%" headers="d0e119 ">*EXCLRD, *SHRUPD, *SHRNUP, or *SHRRD</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p>You can specify all five lock states (*EXCL, *EXCLRD, SHRUPD, SHRNUP,
|
|
and SHRRD) for most object types. this does not apply to <em>all</em> object
|
|
types. Object types that <strong>cannot</strong> have all five lock states specified
|
|
are listed in the following table with valid lock states for the object type:</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><caption>Table 2. Valid Lock States for Specific Object Types</caption><thead align="left"><tr><th align="left" valign="bottom" width="20.74074074074074%" id="d0e167">Object Type</th>
|
|
<th align="left" valign="bottom" width="15%" id="d0e169">*EXCL</th>
|
|
<th align="left" valign="bottom" width="16.296296296296298%" id="d0e171">*EXCLRD</th>
|
|
<th align="left" valign="bottom" width="16.296296296296298%" id="d0e173">*SHRUPD</th>
|
|
<th align="left" valign="bottom" width="16.296296296296298%" id="d0e175">*SHRNUP</th>
|
|
<th align="left" valign="bottom" width="15.37037037037037%" id="d0e177">*SHRRD</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td align="left" valign="top" width="20.74074074074074%" headers="d0e167 ">Device description</td>
|
|
<td align="center" valign="top" width="15%" headers="d0e169 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e171 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e173 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e175 "> </td>
|
|
<td align="center" valign="top" width="15.37037037037037%" headers="d0e177 "> </td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="20.74074074074074%" headers="d0e167 ">Library</td>
|
|
<td align="center" valign="top" width="15%" headers="d0e169 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e171 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e173 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e175 ">x</td>
|
|
<td align="center" valign="top" width="15.37037037037037%" headers="d0e177 ">x</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="20.74074074074074%" headers="d0e167 ">Message queue</td>
|
|
<td align="center" valign="top" width="15%" headers="d0e169 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e171 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e173 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e175 "> </td>
|
|
<td align="center" valign="top" width="15.37037037037037%" headers="d0e177 ">x</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="20.74074074074074%" headers="d0e167 ">Panel group</td>
|
|
<td align="center" valign="top" width="15%" headers="d0e169 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e171 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e173 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e175 "> </td>
|
|
<td align="center" valign="top" width="15.37037037037037%" headers="d0e177 "> </td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="20.74074074074074%" headers="d0e167 ">Program</td>
|
|
<td align="center" valign="top" width="15%" headers="d0e169 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e171 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e173 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e175 "> </td>
|
|
<td align="center" valign="top" width="15.37037037037037%" headers="d0e177 ">x</td>
|
|
</tr>
|
|
<tr><td align="left" valign="top" width="20.74074074074074%" headers="d0e167 ">Subsystem description</td>
|
|
<td align="center" valign="top" width="15%" headers="d0e169 ">x</td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e171 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e173 "> </td>
|
|
<td align="center" valign="top" width="16.296296296296298%" headers="d0e175 "> </td>
|
|
<td align="center" valign="top" width="15.37037037037037%" headers="d0e177 "> </td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section"><p>It is not an error if the DLCOBJ command is issued against an
|
|
object where you do not have a lock or do not have the specific lock state
|
|
requested to be allocated.</p>
|
|
<p>You can change the lock state of an object,
|
|
as the following example shows: </p>
|
|
<pre>PGM
|
|
ALCOBJ OBJ((FILEX *FILE *EXCL)) WAIT(0)
|
|
CALL PGMA
|
|
ALCOBJ OBJ((FILEX *FILE *EXCLRD))
|
|
DLCOBJ OBJ((FILEX *FILE *EXCL))
|
|
CALL PGMB
|
|
DLCOBJ OBJ((FILEX *FILE *EXCLRD))
|
|
ENDPGM</pre>
|
|
<p>File FILEX is allocated exclusively for PGMA, but FILEX is
|
|
allocated as exclusive-allow-read for PGMB.</p>
|
|
<p>You can use record locks
|
|
to allocate data records within a file. You can also use the WAITFILE parameter
|
|
on a <span class="cmdname">Create File (CRTF)</span> command to specify
|
|
how long your program is to wait for that file before a time-out occurs.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="allor.htm" title="Objects are allocated on the system to guarantee integrity and to promote the highest possible degree of concurrency.">Allocate resources</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |