Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 34815 invoked from network); 14 Feb 2005 19:51:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Feb 2005 19:51:16 -0000 Received: (qmail 73990 invoked by uid 500); 14 Feb 2005 19:51:16 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 73960 invoked by uid 500); 14 Feb 2005 19:51:15 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 73946 invoked by uid 99); 14 Feb 2005 19:51:15 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from ajax-1.apache.org (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 14 Feb 2005 11:51:15 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (8.12.11/8.12.11) with ESMTP id j1EJpC8Y027503 for ; Mon, 14 Feb 2005 20:51:12 +0100 Message-ID: <1490011242.1108410672418.JavaMail.jira@ajax.apache.org> Date: Mon, 14 Feb 2005 20:51:12 +0100 (CET) From: "Mike Matrigali (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Closed: (DERBY-145) RAFContainer readPage method is not thread safe In-Reply-To: <1200341878.1108257071987.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-145?page=history ] Mike Matrigali closed DERBY-145: -------------------------------- Assign To: Mike Matrigali Resolution: Won't Fix > RAFContainer readPage method is not thread safe > ----------------------------------------------- > > Key: DERBY-145 > URL: http://issues.apache.org/jira/browse/DERBY-145 > Project: Derby > Type: Bug > Components: Store > Versions: 10.0.2.1 > Environment: N/A > Reporter: Rick Post > Assignee: Mike Matrigali > Priority: Minor > > readPage method comment says 'thread safe and has a synchronized block. > But 'pageOffset' computation occurs outside the sync block as does decryption. > This allows the (remote?) possibility of part of the operation(s) being performed using the wrong pageNumber or pageData. > Fix - synchronize the method rather than the block > /** > Read a page into the supplied array. >
MT - thread safe > @exception IOException exception reading page > @exception StandardException Standard Cloudscape error policy > */ > protected void readPage(long pageNumber, byte[] pageData) > throws IOException, StandardException > { > if (SanityManager.DEBUG) { > SanityManager.ASSERT(!getCommittedDropState()); > } > long pageOffset = pageNumber * pageSize; > synchronized (this) { > fileData.seek(pageOffset); > fileData.readFully(pageData, 0, pageSize); > } > if (dataFactory.databaseEncrypted() && > pageNumber != FIRST_ALLOC_PAGE_NUMBER) > { > decryptPage(pageData, pageSize); > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira