db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant <prash...@pramati.com>
Subject Derby : Lock time out in Read commited mode
Date Fri, 02 Mar 2007 05:32:24 GMT
Hello all,

I am trying to debug a lock time out issue. After turning on debug as 
advised in the FAQ[1], I am trying to make sense of the lock table dump 
that derby wrote to the log file when the lock timed out occurred.

The test case involves two threads one inserting to Database, while 
other thread reads from the same database.

The isolation level is default which I think is Read Committed[2].

Now what i do not understand is that the read query (XID 8520) is 
waiting to obtain a Shared (S) lock on a Row that the insert thread (XID 
8519) has obtained exclusive lock for. How could this be possible in a 
Read committed mode ?

Also the same test case passes when run using Oracle database.

Enclosed with the email is the lock table in question.

Copy pasting here the two XIDs in question :

$ cat lockTableDump.txt | grep "(3,259)"
8520      |ROW          |S   |0        |(3,259)
8519      |ROW          |X   |1        |(3,259)


The select query of XID 8520 is a sub query.

The replication scenario currently runs on our application database, and 
i do not have a unit test case. But can someone please advice on what 
situations in a Read Committed isolation level this kind of locking may 
occur.

The Derby version is the latest 10.2.

Thank you,
-Prashant

[1] : http://db.apache.org/derby/faq.html#debug_lock_timeout
[2] : http://db.apache.org/derby/docs/10.2/devguide/cdevconcepts15366.html

Mime
View raw message