<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>empty pages &#187; plsql</title> <atom:link href="http://look-in.net/category/oracle/plsql/feed/" rel="self" type="application/rss+xml" /><link>http://look-in.net</link> <description></description> <lastBuildDate>Mon, 05 Dec 2011 06:07:14 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>User locks in Oracle</title><link>http://look-in.net/2006/08/18/user-lock-in-oracle/</link> <comments>http://look-in.net/2006/08/18/user-lock-in-oracle/#comments</comments> <pubDate>Fri, 18 Aug 2006 18:29:48 +0000</pubDate> <dc:creator>slookin</dc:creator> <category><![CDATA[oracle]]></category> <category><![CDATA[plsql]]></category> <guid
isPermaLink="false">http://localhost/wordpress/?p=21</guid> <description><![CDATA[As we know, we can use dbms_lock package to manage our application locks. For example we can create &#171;lock&#187; for synchronize logic in application or you can &#171;lock&#187; your external resources (file handler, network sockets etc).
You can use different modes for lock your user resource:
nl -&#62; &#171;NuLl&#187;
ss -&#62; &#171;Sub Shared&#187;
sx -&#62; &#171;Sub eXclusive&#187;
s -&#62; &#171;Shared&#187;
ssx [...]]]></description> <content:encoded><![CDATA[<p>As we know, we can use dbms_lock package to manage our application locks. For example we can create &laquo;lock&raquo; for synchronize logic in application or you can &laquo;lock&raquo; your external resources (file handler, network sockets etc).</p><p><span
id="more-21"></span></p><p>You can use different modes for lock your user resource:</p><ul><li>nl -&gt; &laquo;NuLl&raquo;</li><li>ss -&gt; &laquo;Sub Shared&raquo;</li><li>sx -&gt; &laquo;Sub eXclusive&raquo;</li><li>s -&gt; &laquo;Shared&raquo;</li><li>ssx -&gt; &laquo;Shared Sub eXclusive&raquo;,</li><li>x -&gt; &laquo;eXclusive&raquo;</li></ul><p>The following table is important to understand difference between lock modes:</p><p>If one process &laquo;held&raquo; lock, and other try to get lock &#8211; it get result from this table:</p><p><img
src="http://look-in.net/wp-content/uploads/2007/11/blocks.gif" alt="blocks.gif" /></p><p>Also you can manage timeout to get lock, if resource locked your process will wait during &laquo;timeout&raquo;.</p><p>For example:</p><p><img
src="http://look-in.net/wp-content/uploads/2007/11/blocks2.gif" alt="blocks2.gif" /></p><p>The first process create lock to resource, because resource is free. (for example mode S)</p><p>Second process try to get lock with short timeout and incompatible lock mode (X) , it return value 1 &#8211; TimeOut.</p><p>Third process has log timeout and it create new lock after all previous lock was released.</p><p>Fourth process create new user lock because it has compatible lock mode. (for example S.</p><p>For monitoring user locks you should use:</p><ul><li>dba_lock view (or v$lock),</li><li>DBMS_LOCK_ALLOCATED view</li><li>v$session view</li><li><code>UTLLOCKT.SQL script</code></li></ul><p>documentation:</p><ul><li><a
href="http://www.lc.leidenuniv.nl/awcourse/oracle/appdev.920/a96612/d_lock.htm#998100" target="_blank">DBMS_LOCK package</a></li><li><a
href="http://www.lc.leidenuniv.nl/awcourse/oracle/appdev.920/a96590/adg08sql.htm#2499" target="_blank">About User Locks</a></li></ul><p>version: Oracle 9.2</p> ]]></content:encoded> <wfw:commentRss>http://look-in.net/2006/08/18/user-lock-in-oracle/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
