66 lines
4.0 KiB
HTML
66 lines
4.0 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="Check connection status" />
|
|
<meta name="abstract" content="If running in an environment where it is possible to have read-only connections, the status of the connection should be checked before doing committable updates. This will prevent the unit of work from entering the rollback required state." />
|
|
<meta name="description" content="If running in an environment where it is possible to have read-only connections, the status of the connection should be checked before doing committable updates. This will prevent the unit of work from entering the rollback required state." />
|
|
<meta name="DC.subject" content="connection status, determining, example, examples, determining connection status" />
|
|
<meta name="keywords" content="connection status, determining, example, examples, determining connection status" />
|
|
<meta name="DC.Relation" scheme="URI" content="rbafyduwex.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="rbafydrdacheck1" />
|
|
<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>Check connection status</title>
|
|
</head>
|
|
<body id="rbafydrdacheck1"><a name="rbafydrdacheck1"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Check connection status</h1>
|
|
<div><p>If running in an environment where it is possible to have read-only
|
|
connections, the status of the connection should be checked before doing committable
|
|
updates. This will prevent the unit of work from entering the rollback required
|
|
state.</p>
|
|
<div class="section"><p>The following COBOL example shows how to check the connection
|
|
status.</p>
|
|
</div>
|
|
<div class="example"> <div class="fignone"><span class="figcap">Figure 1. Example of checking connection status</span><pre> …
|
|
EXEC SQL
|
|
<strong>SET CONNECTION</strong> SYS5
|
|
END-EXEC.
|
|
…
|
|
* Check if the connection is updatable.
|
|
EXEC SQL <strong>CONNECT</strong> END-EXEC.
|
|
* If connection is updatable, update sales information otherwise
|
|
* inform the user.
|
|
IF SQLERRD(3) = 1 THEN
|
|
EXEC SQL
|
|
<strong>INSERT INTO</strong> SALES_TABLE
|
|
<strong>VALUES</strong>(:SALES-DATA)
|
|
END-EXEC
|
|
ELSE
|
|
DISPLAY 'Unable to update sales information at this time'.
|
|
…</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyduwex.htm" title="Distributed unit of work (DUW) allows access to multiple application servers within the same unit of work. Each SQL statement can access only one application server. Using distributed unit of work allows changes at multiple applications servers to be committed or rolled back within a single unit of work.">Distributed unit of work</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |