db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Pendleton" <bryanwpendle...@gmail.com>
Subject Re: AW: locking problem when selecting data
Date Fri, 15 Jun 2007 04:52:19 GMT
> > situation. The central question is, why are there any locks held for nothing
> > selected?

Sometimes, a lock is held for the case where nothing was selected,
to prevent the insertion of a new row that would have satisfied the
criteria, had it been present at the time of the original select.

That is, if I select a row where SocSecNo=123456789, and there are
no rows found, but I have not yet committed, Derby may keep a lock
on that "area" of the table to prevent anybody else from inserting such
a row prior to my commit.

That way, if I re-run the same select later in my same transaction,
I'll get the same results. If I am remembering my terminology
correctly, this was known as the "repeatable read" behavior.



View raw message