Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Hit deadlock with 2 threads updating DIFFERENT tables! Why?

Hit deadlock with 2 threads updating DIFFERENT tables! Why?

From: theRat <john_hilgedick_at_yahoo.com>
Date: 11 May 2006 11:15:12 -0700
Message-ID: <1147371312.776648.139490@j33g2000cwa.googlegroups.com>

Hey all,

I have a deadlock situation that I can't figure out. I have one thread that creates a connection to the DB, starts a transaction, and then does a "select for update" on a table called "managers". I have a second thread that creates a connection to the DB, starts a transaction, and then does an "update task blah blah blah" - it is updating a row in a second, DIFFERENT table. Yet, I get deadlock. Why?

Here's the trace that oracle produced for me. I have to admit, I'm not good at interpreting these files. But it seems to me that neither of the SQL statements below could conflict with each other. Also, it seems to me that it is practically and theoretically IMPOSSIBLE to obtain deadlock when one of the threads is using a BRAND new connection and brand new transaction and hasn't locked anything yet.

Anyone have any thoughts?

-john

Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.4.0 - Production
ORACLE_HOME = /app/oracle/product/9.2.0
System name: Linux

Node name:      olympus
Release:        2.4.21-20.ELsmp
Version:        #1 SMP Wed Aug 18 20:46:40 EDT 2004
Machine:        i686

Instance name: SDS
Redo thread mounted by this instance: 1
Oracle process number: 105
Unix process pid: 20337, image: oracle_at_olympus (TNS V1-V3)

update TASK set version=:1, parent=:2, status=:3, taskType=:4, orderNo=:5, retryCount=:6, processCode=:7, message=:8, creationDate=:9, lastModifiedDate=:10, data=:11, description=:12, externalId=:13, serviceSessionId=:14, serviceStatus=:15, servicePort=:16, serviceAddress=:17, instanceId=:18, PROCESSID=:19, MANAGERID=:20 where id=:21 and version=:22
Session 125:
  pid=70 serial=50100 audsid=4140786 user: 71/SDS11   O/S info: user: fff, term: unknown, ospid: , machine: blahblah.com

            program: JDBC Thin Client
  application name: JDBC Thin Client, hash value=0   Current SQL Statement:

update TASK set version=:1, parent=:2, status=:3, taskType=:4, orderNo=:5, retryCount=:6, processCode=:7, message=:8, creationDate=:9, lastModifiedDate=:10, data=:11, description=:12, externalId=:13, serviceSessionId=:14, serviceStatus=:15, servicePort=:16, serviceAddress=:17, instanceId=:18, PROCESSID=:19, MANAGERID=:20 where id=:21 and version=:22
End of information on OTHER waiting sessions.



PROCESS STATE
Received on Thu May 11 2006 - 13:15:12 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US