From derby-dev-return-66320-apmail-db-derby-dev-archive=db.apache.org@db.apache.org Tue Feb 17 07:08:22 2009 Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 50886 invoked from network); 17 Feb 2009 07:08:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Feb 2009 07:08:21 -0000 Received: (qmail 77030 invoked by uid 500); 17 Feb 2009 07:08:20 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 77004 invoked by uid 500); 17 Feb 2009 07:08:20 -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 76994 invoked by uid 99); 17 Feb 2009 07:08:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 16 Feb 2009 23:08:20 -0800 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Feb 2009 07:08:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F0B6A234C4C5 for ; Mon, 16 Feb 2009 23:07:59 -0800 (PST) Message-ID: <570689087.1234854479984.JavaMail.jira@brutus> Date: Mon, 16 Feb 2009 23:07:59 -0800 (PST) From: "Cheng Che Chen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-646) In-memory backend storage support In-Reply-To: <1527660289.1130261635642.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-646?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12674113#action_12674113 ] Cheng Che Chen commented on DERBY-646: -------------------------------------- BTW, there appears to be a discrepancy between code in the constructor of (StorageFactoryService) and documentation for StorageFactory.newStorageFile(String path). In the constructor of (StorageFactoryService), there is this block of code: rootStorageFactory = getStorageFactoryInstance( true, null, null, null); if( home != null) { StorageFile rootDir = rootStorageFactory.newStorageFile( null); rootDir.mkdirs(); } Now, according to the javadoc for StorageFactory.newStorageFile(String path), when the parameter (path) is null, we should return the database directory. But in the above code block, the parameter representing the database directory passed into the initialization of the storage factory, is null. According to the documentation for StorageFactory.init(), when the database name parameter is null, we will only work with the home directory. So I believe the author of the above code block intended (rootDir) to represent the home directory in this case (i.e., when the database parameter is null). This behavior, however, is not specified in the documentation for StorageFactory.newStorageFile(String path). I noticed this discrepancy during manual testing because I was getting (NullPointerException) at the call to rootDir.mkdirs() with my storage factory implementation. I worked around the problem by having my implementation of newStorageFile(String path) return the home directory when the internal database parameter is null, in the case when the input (path) parameter is null. In any event, there appears to be a discrepancy between code and documentation, unless I have misinterpreted the code and/or the documentation. > In-memory backend storage support > --------------------------------- > > Key: DERBY-646 > URL: https://issues.apache.org/jira/browse/DERBY-646 > Project: Derby > Issue Type: New Feature > Components: Store > Environment: All > Reporter: Stephen Fitch > Attachments: derby-646-1a-raw-compiles.diff, derby-646-1a-raw-compiles.stat, svn.diff > > > To allow creation and modification of databases in-memory without requiring disk access or space to store the database. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.