Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 99516 invoked from network); 26 Oct 2010 09:17:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Oct 2010 09:17:19 -0000 Received: (qmail 52062 invoked by uid 500); 26 Oct 2010 09:17:19 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 51870 invoked by uid 500); 26 Oct 2010 09:17:17 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 51862 invoked by uid 99); 26 Oct 2010 09:17:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 09:17:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Oct 2010 09:17:16 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o9Q9Guq9010492 for ; Tue, 26 Oct 2010 09:16:56 GMT Message-ID: <4346667.75951288084616239.JavaMail.jira@thor> Date: Tue, 26 Oct 2010 05:16:56 -0400 (EDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4685) Dead/unreachable code in OpenConglomerate.lockPositionForWrite() In-Reply-To: <21183825.112481275420518090.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-4685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-4685: -------------------------------------- Issue & fix info: [Patch Available] Assignee: Knut Anders Hatlen > Dead/unreachable code in OpenConglomerate.lockPositionForWrite() > ---------------------------------------------------------------- > > Key: DERBY-4685 > URL: https://issues.apache.org/jira/browse/DERBY-4685 > Project: Derby > Issue Type: Improvement > Components: Store > Affects Versions: 10.7.1.0 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Priority: Minor > Attachments: d4685.diff > > > OpenConglomerate.lockPositionForWrite() contains this code twice: > if (!waitForLock) > { > // throw lock timeout error. > throw StandardException.newException(SQLState.LOCK_TIMEOUT); > } > The second occurrence of this code can never end up throwing an exception, since waitForLock is guaranteed to be true there because of the identical check a couple of lines above. (Judging by the similar method lockPositionForRead(), it is probably the first check that should be removed, so that the latch on the page is released before the exception is thrown.) > Also, the method is always called with forInsert==false, so the forInsert parameter can be removed. (I also suspect that the method doesn't work correctly if ever used in an insert operation, since it calls latchPage(RowPosition) which will unlatch the page if the row isn't found on the page, and I assume that a row that is about to be inserted does not exist yet.) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.