Hi Ivan,

On Nov 21, 2010, at 8:37, Ivan Shcheklein wrote:
> 
> See http://en.wikipedia.org/wiki/Two-phase_locking, Deadlocks in 2PL . Sedna
> aborts transaction using wait-for-graph as described in that article. You
> should manually restart it if you need.
> 

I can't quite figure out why I am getting the deadlock though.

My (FIFO queue-like) code looks like this in ruby'esque code

Process 1
---------

sedna.execute("update insert <data>...</data> preceding 
doc('somedoc')/a/b/tail")

Process 2
----------

sedna.transaction {
  sedna.execute("doc('somedoc')/a/b/data[1]")
  sedna.execute("update delete doc('somedoc')/a/b/data[1]")
}

My assumption was that Process 1 using only a single query would be atomic and 
Process 2 requires the transaction wrapper to maintain atomicity. If Process 2 
gets context switched after the 1st query and Process 1 tries to execute a 
query, Process 1 will block and Process 2 will get to run and complete the 
transaction before Process 1 can execute it's query.

Is here an error in my logic?

Regards,
Spencer


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Sedna-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sedna-discussion

Reply via email to