[
https://issues.apache.org/jira/browse/DERBY-2197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463273
]
Knut Anders Hatlen commented on DERBY-2197:
-------------------------------------------
Attaching a new patch (derby-2197-v1.diff) which also updates the
storeunit tests. I successfully ran derbyall on Solaris with Sun's JVM
1.5.0 and the JUnit tests with Sun's JVM 1.6.0. Derbyall also ran
cleanly when only the changes to the java/testing subtree were
applied.
The only change in the engine code from the previous patch
(derby-2197-engine.diff) is a small modification of the assert in
GenericScanController.replace(). The old assert only checked that the
container was not opened in row locking mode, but it failed in
T_AccessFactory. However, replace() calls repositionScanForUpateOper()
which obtains a write lock if update locks are used, so the record
should already be locked. Therefore, I made the assert also check
whether update locks were used, and then T_AccessFactory succeeded.
unitTests/services/T_LockFactory.java was modified so that it doesn't
test the lockObject() method that was removed from LockFactory.
The tests in unitTests/store that call Page.fetch(), Page.delete() and
Page.update() directly, now use fetchFromSlot(), deleteAtSlot() and
updateAtSlot() instead. This changes what's being tested, since the
*Slot() methods don't perform any locking. I don't think that's a
problem since these tests don't depend on locking. Although some of
them are multi-threaded, each thread creates its own set of containers
that it's working on. It also seems like the original test cases use
the locking and non-locking variants of the methods more or less at
random, so I don't believe the locking behaviour is essential in these
tests.
In T_RawStoreFactory, the tests P003, P004 and P052 were removed
because their comments said they were tests for Page.update() and
Page.delete(), which this patch deleted.
The patch is ready for review.
> Remove unused code for locking rows while holding a latch
> ---------------------------------------------------------
>
> Key: DERBY-2197
> URL: https://issues.apache.org/jira/browse/DERBY-2197
> Project: Derby
> Issue Type: Improvement
> Components: Services, Store, Test
> Affects Versions: 10.3.0.0
> Reporter: Knut Anders Hatlen
> Assigned To: Knut Anders Hatlen
> Priority: Minor
> Attachments: derby-2197-engine.diff, derby-2197-engine.stat,
> derby-2197-v1.diff, derby-2197-v1.stat
>
>
> Some of the code for locking a row while holding a latch doesn't seem to be
> used outside the unit tests for store. This code should be removed in order
> to reduce the overall complexity. See the discussion in DERBY-2107 for
> details.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira