db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Korneliussen <Andreas.Kornelius...@Sun.COM>
Subject Re: [jira] Updated: (DERBY-1696) transaction may sometimes keep lock on a row after moving off the resultset in scrollable updatable resultset
Date Mon, 28 Aug 2006 12:21:36 GMT

>> Can you just close the scan if you don't need it positioned anymore?
> I'll check if that works

The problem is that we need it re-positioned later, i.e if the user
moves to the afterLast() position and then scrolls to any other row, we
need to lock that row.

If the scan has been closed with close(), we cannot reopen it. If it has
been closed with closeForEndTransaction(.) we may reopen it, however
that would be quite undesirable, since we are not ending the
transaction, and we do not access the scancontroller from ScanManager
(which has closeForEndTransaction(.).

An alternative which I have considered is to make
ScanController.positionAtRowLocation(..) handle this by adding semantics
to the RowLocation being NULL.

I.e in HeapScan.java add this:

 public boolean positionAtRowLocation(RowLocation rl) throws
StandardException {
        if (rl==null)

positionAtDoneScan will set the scan state to SCAN_DONE and release lock
as desired.


View raw message