db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Releasing latches when waiting for locks. When and why?
Date Fri, 17 Nov 2006 15:25:13 GMT
Hi,

I have come across some use of locks and latches which I don't
understand. One of the lockObject() methods in the lock manager
(SinglePool.lockObject(Object, Lockable, Object, int, Latch)) takes a
Latch parameter. When this method is used, the specified latch will be
released if the lock cannot be obtained immediately, and that page
will be re-latched when the lock has been obtained.

Does anyone know what this method is used for? I have tried to find a
code path to it from the JDBC methods, but I have not found such a
path yet. Actually, I even modified the method so that it threw an
exception each time it was called, and ran derbyall and the JUnit
tests. Only some of the storeunit tests failed, but they invoke the
methods of StoredPage and friends directly, so they don't really
count.

So, when none of the tests that use our public interface use this kind
of locking, when and for what purpose is it used?

Thanks,
-- 
Knut Anders

Mime
View raw message