<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Faulty Quotes 7 &#8211; Deadlock Kills Sessions?</title>
	<atom:link href="http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/feed/" rel="self" type="application/rss+xml" />
	<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/</link>
	<description>Miscellaneous Random Oracle Topics: Stop, Think, ... Understand</description>
	<lastBuildDate>Mon, 13 May 2013 14:10:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: pvh</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4257</link>
		<dc:creator><![CDATA[pvh]]></dc:creator>
		<pubDate>Fri, 06 Jan 2012 13:37:18 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4257</guid>
		<description><![CDATA[Thanks for the inputs Charles, I will check that out.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the inputs Charles, I will check that out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4256</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Fri, 06 Jan 2012 12:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4256</guid>
		<description><![CDATA[pvh,

It was a good idea to try a deadlock involving a TM enqueue.  You can find another interesting example of a TM enqueue here:
http://hoopercharles.wordpress.com/2010/01/07/deadlock-on-oracle-11g-but-not-on-10g/

Please keep in mind that a TM enqueue will not necessarily lead to a deadlock, and that a deadlock involving a TM equeue will not kill the sessions that ends up being the deadlock &quot;victim&quot; (this might not have been clear because of all of the incorrect quotes from the various books).

I had a little bit of trouble when I tried to recreate your test case:
In Session 1:
&lt;pre&gt;
SELECT sys_context(&#039;USERENV&#039;, &#039;SID&#039;) FROM DUAL;

SYS_CONTEXT(&#039;USERENV&#039;,&#039;SID&#039;)
----------------------------
223

CREATE TABLE emp(
emp_id number(5) not null,
emp_name varchar2(35) not null,
address varchar2(50),
CONSTRAINT empid_pk PRIMARY KEY (emp_id)
);

INSERT INTO emp VALUES (1, &#039;xyz&#039;, &#039;addr1&#039;);
INSERT INTO emp VALUES (2, &#039;abc&#039;, &#039;addr2&#039;);
COMMIT;

DELETE from emp WHERE emp_id = 1;
&lt;/pre&gt;

In Session 2:
&lt;pre&gt;
SELECT sys_context(&#039;USERENV&#039;, &#039;SID&#039;) FROM DUAL;

SYS_CONTEXT(&#039;USERENV&#039;,&#039;SID&#039;)
----------------------------
222

CREATE TABLE dept
(dept_id     number(8)     not null,
dept_name    varchar2(35)    not null,
emp_id     number(5)     not null,
CONSTRAINT fk_emp
FOREIGN KEY (emp_id)
REFERENCES emp(emp_id) ON DELETE CASCADE
);

CREATE TABLE dept
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
&lt;/pre&gt;
I could not create the DEPT table in Session 2 because Session 1 was already a TX lock on the EMP table.  We need to change the order of the commands a little.

Fixing up the order of the commands and modifying the script to actually trigger a deadlock:
In Session 1:
&lt;pre&gt;
ROLLBACK;
&lt;/pre&gt;

In Session 2:
&lt;pre&gt;
ROLLBACK;
&lt;/pre&gt;

In Session 1:
&lt;pre&gt;
CREATE TABLE dept
(dept_id     number(8)     not null,
dept_name    varchar2(35)    not null,
emp_id     number(5)     not null,
CONSTRAINT fk_emp
FOREIGN KEY (emp_id)
REFERENCES emp(emp_id) ON DELETE CASCADE
);

INSERT INTO dept VALUES (1, &#039;dep1&#039;, 1);
INSERT INTO dept VALUES (2, &#039;dep2&#039;, 1);
INSERT INTO dept VALUES (3, &#039;dep3&#039;, 2);
COMMIT;

DELETE from emp WHERE emp_id = 1;
&lt;/pre&gt;

In Session 2:
&lt;pre&gt;
INSERT INTO emp VALUES (3, &#039;abc&#039;, &#039;addr2&#039;);
 
DELETE from emp WHERE emp_id = 2;
&lt;/pre&gt;
(Session 2 is hung)

In Session 1:
&lt;pre&gt;
INSERT INTO emp VALUES (3, &#039;abc&#039;, &#039;addr2&#039;);
&lt;/pre&gt;

Session 2 Shows:
&lt;pre&gt;
DELETE from emp WHERE emp_id = 2
            *
ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource
&lt;/pre&gt;
(Session 1 is still hung)

In Session 2:
&lt;pre&gt;
SELECT
  *
FROM
  EMP
WHERE
  EMP_ID=3;
 
EMP_ID EMP_NAME                            ADDRESS
------ ----------------------------------- -------
     3 abc                                 addr2
&lt;/pre&gt;
The above shows that Session 2 was still connected to the database, and that the first row inserted by Session 2 was not rolled back by an automatic transaction rollback (there was an automatic statement-level rollback).

This is the deadlock graph that was written to the trace file:
&lt;pre&gt;
Deadlock graph:
                       ---------Blocker(s)--------  ---------Waiter(s)---------
Resource Name          process session holds waits  process session holds waits
TX-00040016-0000085a        23     222     X             31     223           S
TM-00011c1a-00000000        31     223    SX             23     222    SX   SSX
 
session 222: DID 0001-0017-000002D9	session 223: DID 0001-001F-00000001 
session 223: DID 0001-001F-00000001	session 222: DID 0001-0017-000002D9 
 
Rows waited on:
  Session 222: no row
  Session 223: no row
 
----- Information for the OTHER waiting sessions -----
Session 223:
  sid: 223 ser: 25 audsid: 235217 user: 62/TESTUSER
    flags: (0x45) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
    flags2: (0x40008) -/-
  pid: 31 O/S info: user: SYSTEM, term: AIRFORCE-1, ospid: 15824
    image: ORACLE.EXE (SHAD)
  client details:
    O/S info: user: hooper, term: AIRFORCE-1, ospid: 9392:15596
    machine: AIRFORCE-1 program: sqlplus.exe
    application name: SQL*Plus, hash value=3669949024
  current SQL:
  INSERT INTO emp VALUES (3, &#039;abc&#039;, &#039;addr2&#039;)
 
----- End of information for the OTHER waiting sessions -----
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>pvh,</p>
<p>It was a good idea to try a deadlock involving a TM enqueue.  You can find another interesting example of a TM enqueue here:<br />
<a href="http://hoopercharles.wordpress.com/2010/01/07/deadlock-on-oracle-11g-but-not-on-10g/" rel="nofollow">http://hoopercharles.wordpress.com/2010/01/07/deadlock-on-oracle-11g-but-not-on-10g/</a></p>
<p>Please keep in mind that a TM enqueue will not necessarily lead to a deadlock, and that a deadlock involving a TM equeue will not kill the sessions that ends up being the deadlock &#8220;victim&#8221; (this might not have been clear because of all of the incorrect quotes from the various books).</p>
<p>I had a little bit of trouble when I tried to recreate your test case:<br />
In Session 1:</p>
<pre>
SELECT sys_context('USERENV', 'SID') FROM DUAL;

SYS_CONTEXT('USERENV','SID')
----------------------------
223

CREATE TABLE emp(
emp_id number(5) not null,
emp_name varchar2(35) not null,
address varchar2(50),
CONSTRAINT empid_pk PRIMARY KEY (emp_id)
);

INSERT INTO emp VALUES (1, 'xyz', 'addr1');
INSERT INTO emp VALUES (2, 'abc', 'addr2');
COMMIT;

DELETE from emp WHERE emp_id = 1;
</pre>
<p>In Session 2:</p>
<pre>
SELECT sys_context('USERENV', 'SID') FROM DUAL;

SYS_CONTEXT('USERENV','SID')
----------------------------
222

CREATE TABLE dept
(dept_id     number(8)     not null,
dept_name    varchar2(35)    not null,
emp_id     number(5)     not null,
CONSTRAINT fk_emp
FOREIGN KEY (emp_id)
REFERENCES emp(emp_id) ON DELETE CASCADE
);

CREATE TABLE dept
*
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
</pre>
<p>I could not create the DEPT table in Session 2 because Session 1 was already a TX lock on the EMP table.  We need to change the order of the commands a little.</p>
<p>Fixing up the order of the commands and modifying the script to actually trigger a deadlock:<br />
In Session 1:</p>
<pre>
ROLLBACK;
</pre>
<p>In Session 2:</p>
<pre>
ROLLBACK;
</pre>
<p>In Session 1:</p>
<pre>
CREATE TABLE dept
(dept_id     number(8)     not null,
dept_name    varchar2(35)    not null,
emp_id     number(5)     not null,
CONSTRAINT fk_emp
FOREIGN KEY (emp_id)
REFERENCES emp(emp_id) ON DELETE CASCADE
);

INSERT INTO dept VALUES (1, 'dep1', 1);
INSERT INTO dept VALUES (2, 'dep2', 1);
INSERT INTO dept VALUES (3, 'dep3', 2);
COMMIT;

DELETE from emp WHERE emp_id = 1;
</pre>
<p>In Session 2:</p>
<pre>
INSERT INTO emp VALUES (3, 'abc', 'addr2');
 
DELETE from emp WHERE emp_id = 2;
</pre>
<p>(Session 2 is hung)</p>
<p>In Session 1:</p>
<pre>
INSERT INTO emp VALUES (3, 'abc', 'addr2');
</pre>
<p>Session 2 Shows:</p>
<pre>
DELETE from emp WHERE emp_id = 2
            *
ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource
</pre>
<p>(Session 1 is still hung)</p>
<p>In Session 2:</p>
<pre>
SELECT
  *
FROM
  EMP
WHERE
  EMP_ID=3;
 
EMP_ID EMP_NAME                            ADDRESS
------ ----------------------------------- -------
     3 abc                                 addr2
</pre>
<p>The above shows that Session 2 was still connected to the database, and that the first row inserted by Session 2 was not rolled back by an automatic transaction rollback (there was an automatic statement-level rollback).</p>
<p>This is the deadlock graph that was written to the trace file:</p>
<pre>
Deadlock graph:
                       ---------Blocker(s)--------  ---------Waiter(s)---------
Resource Name          process session holds waits  process session holds waits
TX-00040016-0000085a        23     222     X             31     223           S
TM-00011c1a-00000000        31     223    SX             23     222    SX   SSX
 
session 222: DID 0001-0017-000002D9	session 223: DID 0001-001F-00000001 
session 223: DID 0001-001F-00000001	session 222: DID 0001-0017-000002D9 
 
Rows waited on:
  Session 222: no row
  Session 223: no row
 
----- Information for the OTHER waiting sessions -----
Session 223:
  sid: 223 ser: 25 audsid: 235217 user: 62/TESTUSER
    flags: (0x45) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
    flags2: (0x40008) -/-
  pid: 31 O/S info: user: SYSTEM, term: AIRFORCE-1, ospid: 15824
    image: ORACLE.EXE (SHAD)
  client details:
    O/S info: user: hooper, term: AIRFORCE-1, ospid: 9392:15596
    machine: AIRFORCE-1 program: sqlplus.exe
    application name: SQL*Plus, hash value=3669949024
  current SQL:
  INSERT INTO emp VALUES (3, 'abc', 'addr2')
 
----- End of information for the OTHER waiting sessions -----
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: pvh</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4254</link>
		<dc:creator><![CDATA[pvh]]></dc:creator>
		<pubDate>Fri, 06 Jan 2012 11:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4254</guid>
		<description><![CDATA[Hi Chalres, But the &quot;enq: TM contention&quot; did&#039;nt killed the session for me:
session1: 
&lt;pre&gt;
SQL&gt; SELECT sys_context(&#039;USERENV&#039;, &#039;SID&#039;) FROM DUAL;

SYS_CONTEXT(&#039;USERENV&#039;,&#039;SID&#039;)
-----------------------------
140

CREATE TABLE emp(
emp_id number(5) not null,
emp_name varchar2(35) not null,
address varchar2(50),
CONSTRAINT empid_pk PRIMARY KEY (emp_id)
);

INSERT INTO emp VALUES (1, &#039;xyz&#039;, &#039;addr1&#039;);
INSERT INTO emp VALUES (2, &#039;abc&#039;, &#039;addr2&#039;);
COMMIT;
    EMP_ID EMP_NAME                            ADDRESS
---------- ----------------------------------- --------------------------------------------------
         1 xyz                                 addr1
         2 abc                                 addr2

DELETE from emp WHERE emp_id = 1;
&lt;/pre&gt;

session2:
&lt;pre&gt;
SQL&gt; SELECT sys_context(&#039;USERENV&#039;, &#039;SID&#039;) FROM DUAL;

SYS_CONTEXT(&#039;USERENV&#039;,&#039;SID&#039;)
--------------------------------------------------------------------------------
21

CREATE TABLE dept
(dept_id     number(8)     not null,
dept_name    varchar2(35)    not null,
emp_id     number(5)     not null,
CONSTRAINT fk_emp
FOREIGN KEY (emp_id)
REFERENCES emp(emp_id) ON DELETE CASCADE
);

INSERT INTO dept VALUES (1, &#039;dep1&#039;, 1);
INSERT INTO dept VALUES (2, &#039;dep2&#039;, 1);
INSERT INTO dept VALUES (3, &#039;dep3&#039;, 2);
COMMIT;

SQL&gt; select * from dept;

   DEPT_ID DEPT_NAME                               EMP_ID
---------- ----------------------------------- ----------
         1 dep1                                         1
         2 dep2                                         1
         3 dep3                                         2

DELETE from emp WHERE emp_id = 2;
&lt;/pre&gt;
(session2 hangs here)

session3:
&lt;pre&gt;
SQL&gt; select sid,serial#,SECONDS_IN_WAIT,STATE,BLOCKING_SESSION,BLOCKING_SESSION_STATUS,event from v$session;

       SID    SERIAL# SECONDS_IN_WAIT STATE               BLOCKING_SESSION BLOCKING_SE EVENT
---------- ---------- --------------- ------------------- ---------------- ----------- ---------------------------------
        21      22260              10 WAITING                          140 VALID       enq: TM - contention
        140     29720              25 WAITING                              NO HOLDER   SQL*Net message from client
........... (edited due to many results)
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>Hi Chalres, But the &#8220;enq: TM contention&#8221; did&#8217;nt killed the session for me:<br />
session1: </p>
<pre>
SQL&gt; SELECT sys_context('USERENV', 'SID') FROM DUAL;

SYS_CONTEXT('USERENV','SID')
-----------------------------
140

CREATE TABLE emp(
emp_id number(5) not null,
emp_name varchar2(35) not null,
address varchar2(50),
CONSTRAINT empid_pk PRIMARY KEY (emp_id)
);

INSERT INTO emp VALUES (1, 'xyz', 'addr1');
INSERT INTO emp VALUES (2, 'abc', 'addr2');
COMMIT;
    EMP_ID EMP_NAME                            ADDRESS
---------- ----------------------------------- --------------------------------------------------
         1 xyz                                 addr1
         2 abc                                 addr2

DELETE from emp WHERE emp_id = 1;
</pre>
<p>session2:</p>
<pre>
SQL&gt; SELECT sys_context('USERENV', 'SID') FROM DUAL;

SYS_CONTEXT('USERENV','SID')
--------------------------------------------------------------------------------
21

CREATE TABLE dept
(dept_id     number(8)     not null,
dept_name    varchar2(35)    not null,
emp_id     number(5)     not null,
CONSTRAINT fk_emp
FOREIGN KEY (emp_id)
REFERENCES emp(emp_id) ON DELETE CASCADE
);

INSERT INTO dept VALUES (1, 'dep1', 1);
INSERT INTO dept VALUES (2, 'dep2', 1);
INSERT INTO dept VALUES (3, 'dep3', 2);
COMMIT;

SQL&gt; select * from dept;

   DEPT_ID DEPT_NAME                               EMP_ID
---------- ----------------------------------- ----------
         1 dep1                                         1
         2 dep2                                         1
         3 dep3                                         2

DELETE from emp WHERE emp_id = 2;
</pre>
<p>(session2 hangs here)</p>
<p>session3:</p>
<pre>
SQL&gt; select sid,serial#,SECONDS_IN_WAIT,STATE,BLOCKING_SESSION,BLOCKING_SESSION_STATUS,event from v$session;

       SID    SERIAL# SECONDS_IN_WAIT STATE               BLOCKING_SESSION BLOCKING_SE EVENT
---------- ---------- --------------- ------------------- ---------------- ----------- ---------------------------------
        21      22260              10 WAITING                          140 VALID       enq: TM - contention
        140     29720              25 WAITING                              NO HOLDER   SQL*Net message from client
........... (edited due to many results)
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damir Vadas</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4251</link>
		<dc:creator><![CDATA[Damir Vadas]]></dc:creator>
		<pubDate>Thu, 05 Jan 2012 16:13:01 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4251</guid>
		<description><![CDATA[Nice. Thank you for sharing.]]></description>
		<content:encoded><![CDATA[<p>Nice. Thank you for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4248</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 20:10:01 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4248</guid>
		<description><![CDATA[Chris,

I think that you are right - it is a bit of a mistaken cause and effect relationship, where the application&#039;s reaction to the ORA error is missing element.]]></description>
		<content:encoded><![CDATA[<p>Chris,</p>
<p>I think that you are right &#8211; it is a bit of a mistaken cause and effect relationship, where the application&#8217;s reaction to the ORA error is missing element.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4247</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 19:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4247</guid>
		<description><![CDATA[Another piece of the puzzle.  Jonathan mentioned something similar in the Oracle Core book - and his writing style made it seem so obvious that it works as he indicated, that I had a hard time understanding why I did not understand the reasoning earlier.  :-)]]></description>
		<content:encoded><![CDATA[<p>Another piece of the puzzle.  Jonathan mentioned something similar in the Oracle Core book &#8211; and his writing style made it seem so obvious that it works as he indicated, that I had a hard time understanding why I did not understand the reasoning earlier.  <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Hooper</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4246</link>
		<dc:creator><![CDATA[Charles Hooper]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 19:49:42 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4246</guid>
		<description><![CDATA[Mohamed,

What you quoted above is very well worded - and matches the test case results at the start of this article.  Thank you for posting the quote.]]></description>
		<content:encoded><![CDATA[<p>Mohamed,</p>
<p>What you quoted above is very well worded &#8211; and matches the test case results at the start of this article.  Thank you for posting the quote.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hourim</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4245</link>
		<dc:creator><![CDATA[hourim]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 19:03:52 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4245</guid>
		<description><![CDATA[There is also a misconception about oracle choosing ARBITRARILY one of the two sessions involved in the deadlocks and rollback one of its statement. The choosen session is not done arbitrarily but it seems that it is the session that start first waiting

http://jonathanlewis.wordpress.com/2011/08/29/deadlock-2/]]></description>
		<content:encoded><![CDATA[<p>There is also a misconception about oracle choosing ARBITRARILY one of the two sessions involved in the deadlocks and rollback one of its statement. The choosen session is not done arbitrarily but it seems that it is the session that start first waiting</p>
<p><a href="http://jonathanlewis.wordpress.com/2011/08/29/deadlock-2/" rel="nofollow">http://jonathanlewis.wordpress.com/2011/08/29/deadlock-2/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hourim</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4244</link>
		<dc:creator><![CDATA[hourim]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 18:56:38 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4244</guid>
		<description><![CDATA[Charles,

In the third OTN link you&#039;ve listed, I gave the following answer
&quot;
When deadlock occurs Oracle will not roll back the entire transaction. It will only do a rollback of one of the statements (belonging to one of the sessions) involded in the deadlock. The other session remains blocked if the session for which one of the statement has been rolled back by Oracle will not commit or rollback.

In other words, in the Justin Cave example, Session 1 will remains blocked if Session 2 will not issue a rollback after it has received the deadlook error

So, the OP should verify that his application must forsee a rollback in case of exception (and the deadlock error could be one of those exceptions)

Hope this helps
&quot;
.]]></description>
		<content:encoded><![CDATA[<p>Charles,</p>
<p>In the third OTN link you&#8217;ve listed, I gave the following answer<br />
&#8221;<br />
When deadlock occurs Oracle will not roll back the entire transaction. It will only do a rollback of one of the statements (belonging to one of the sessions) involded in the deadlock. The other session remains blocked if the session for which one of the statement has been rolled back by Oracle will not commit or rollback.</p>
<p>In other words, in the Justin Cave example, Session 1 will remains blocked if Session 2 will not issue a rollback after it has received the deadlook error</p>
<p>So, the OP should verify that his application must forsee a rollback in case of exception (and the deadlock error could be one of those exceptions)</p>
<p>Hope this helps<br />
&#8221;<br />
.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chris_c</title>
		<link>http://hoopercharles.wordpress.com/2012/01/04/faulty-quotes-7-deadlock-kills-sessions/#comment-4242</link>
		<dc:creator><![CDATA[chris_c]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 14:26:04 +0000</pubDate>
		<guid isPermaLink="false">http://hoopercharles.wordpress.com/?p=5812#comment-4242</guid>
		<description><![CDATA[I wonder if the misconception arises because of the way some client applications handle the error. A badly coded application which crashes on receiving the ORA-00060 usually because there is poor or no error handling could lead to the assumption that oracle has killed the session rather than the client application crashing. We have a wonderful third party application here that on any ORA-* message crashes and dumps a stack trace, as the trace then shows the crash occurred during a database call its the DBA&#039;s fault not the developers.]]></description>
		<content:encoded><![CDATA[<p>I wonder if the misconception arises because of the way some client applications handle the error. A badly coded application which crashes on receiving the ORA-00060 usually because there is poor or no error handling could lead to the assumption that oracle has killed the session rather than the client application crashing. We have a wonderful third party application here that on any ORA-* message crashes and dumps a stack trace, as the trace then shows the crash occurred during a database call its the DBA&#8217;s fault not the developers.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
