Chapter 16. Locking and Concurrency

137 - Chapter 16. Locking and Concurrency <ul><li> <p clas><script> function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window. open (url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); } function Print() { window.focus(); if(window.print) { window.print(); window.setTimeout('window.close();',5000); } } </script><span></span></p> <table width="100%" cellpadding="0" cellspacing="0" border="0"><tr valign="top"></tr></table> <table width="100%" height="20" border="0" cellpadding="0" cellspacing="1"><tr></tr></table> <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr valign="top"><td align="center"><table width="95%"><tr><td align="left"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr><td valign="top" height="5"><img src="/books/2/607/1/html/2/images/pixel.gif" width="1" height="5" alt="" border="0"></td></tr> <tr> <td><b><font size="1" color ="#0000FF">Team-Fly<img border="0" src="/books/2/607/1/html/2/Fly-Logo.gif" width="81" height="25"></font></b></td> <td valign="top" align="right">     </td> </tr> </table> <hr size="1"> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td valign="top" width="76" rowspan="4"><img src="/books/2/607/1/html/2/images/0131007718/0131007718_xs.jpg" width="76" height="95" border="0"></td> <td valign="top">DB2 Universal Database for OS/390 v7.1 Application Certification Guide<br>By Susan Lawson<br> </td> </tr> <tr><td>Table of Contents</td></tr> <tr><td></td></tr> <tr><td valign="bottom">Part 5.  Advanced Programming Functions</td></tr> </table> <hr size ="1"> <br><table width="100%" border="0" cellspacing="0" cellpadding ="0"><tr><td valign="top"> <h2>Chapter 16. Locking and Concurrency</h2> <ul> <li><p>Locking Data</p></li> <li><p>Lock Attributes</p></li> <li><p>Avoiding Locks</p></li> <li><p>Claims and Drains</p></li> <li><p>Escalation and Promotion</p></li> </ul> <p>It would be easy to have one process simply lock all the data while using it, but that of course would lead to other applications being unable to access the data during this time. Concurrency, the ability for multiple applications to access the same data at the same time, needs to be allowed but also controlled so that we prevent lost updates, access to uncommitted data, and unrepeatable reads (data changing between reads).</p> <p>A balance must be achieved for maximum concurrency of all processes. There are many controls in DB2 to allow us to achieve maximum concurrency while maintaining the integrity of our data. These range from the parameters we bind our programs with to options of the DDL for the creation of objects, to subsystem level parameters.</p> <p>DB2 uses locks to control concurrency within a database, that is, to manage simultaneous access to a resource by more than one user (also referred to as serialization). Locks also prevent access to uncommitted data, which prevents updates from becoming lost (part of data integrity) and allows a user to see the same data, without the data ever changing, within a period of processing called a <span>commit scope.</span> From a performance standpoint, everything done in DB2 has a tradeoff. In locking, there is a tradeoff between concurrency and performance, as more concurrency comes at a higher cost of CPU usage due to lock management. There are also cases where DB2 will override the locking strategy designed, because processes hold locked resources exceeding the site established thresholds. However, only certain combinations of parameters cause this to occur.</p> <img src="/books/2/607/1/html/2/images/pixel.gif" width="1" height="1" border="0"> </td></tr></table> <hr size="1"> <table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr><td valign="top" height="5"><img src="/books/2/607/1/html/2/images/pixel.gif" width="1" height="5" alt="" border="0"></td></tr> <tr> <td><b><font size="1" color="#0000FF">Team-Fly<img border="0" src="/books/2/607/1/html/2/Fly-Logo.gif" width="81" height="25"></font></b></td> <td valign="top" align="right">     </td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td valign="top" align="right">Top</td></tr></table> </td></tr></table></td></tr></table> </li></ul>


DB2 Universal Database for OS. 390 v7. 1 Application Certification Guide
DB2(R) Universal Database for OS/390 V7.1 Application Certification Guide (IBM DB2 Certification Guide Series)
ISBN: 0131007718
EAN: 2147483647
Year: 2002
Pages: 163
Authors: Susan Lawson

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net