Hi everyone, I'm wonder if  someone know about a possible deadlock in SDB
with this scenario. I'm not sure if is my app fault of SDB. :)

There are 2 objects which are involved in the deadlock:


   - Nodes
   - Quads


The statements which are failing are:

INSERT INTO Quads
SELECT DISTINCT #NQuads.t0 , #NQuads.t1 , #NQuads.t2 , #NQuads.t3
FROM #NQuads LEFT JOIN Quads ON
 (t0=Quads.g AND t1=Quads.s AND t2=Quads.p AND t3=Quads.o)
WHERE
Quads.g IS NULL OR
Quads.s IS NULL OR
Quads.p IS NULL OR
Quads.o IS NULL

and

INSERT INTO Nodes (hash, lex, lang, datatype, type)
SELECT #NNodeQuads.n0 , #NNodeQuads.n1 , #NNodeQuads.n2 , #NNodeQuads.n3 ,
#NNodeQuads.n4
FROM #NNodeQuads LEFT JOIN Nodes ON (#NNodeQuads.n0=Nodes.hash)
WHERE Nodes.hash IS NULL

Process A has an exclusive lock on nodes and wants a share lock on quads
Process B has an exclusive lock on quads and wants a share lock on nodes

Hence the deadlock!!

regards,

Adrian

Reply via email to