Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 40955 invoked from network); 21 Apr 2009 14:32:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Apr 2009 14:32:11 -0000 Received: (qmail 35000 invoked by uid 500); 21 Apr 2009 14:32:11 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 34965 invoked by uid 500); 21 Apr 2009 14:32:11 -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 34920 invoked by uid 99); 21 Apr 2009 14:32:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 14:32:11 +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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 14:32:09 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B98B7234C04C for ; Tue, 21 Apr 2009 07:31:47 -0700 (PDT) Message-ID: <1116891774.1240324307758.JavaMail.jira@brutus> Date: Tue, 21 Apr 2009 07:31:47 -0700 (PDT) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-4171) Connections to on-disk db go to in-memory db if in-memory db with same name is booted In-Reply-To: <1501248569.1240233587470.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12701166#action_12701166 ] Rick Hillegas commented on DERBY-4171: -------------------------------------- Thanks for thinking about this issue, Knut and Kristian. What do you think the behavior should be: 1) The memory subprotocol defines a separate namespace of databases. In this situation, it should be possible to have two databases with the same name, one in the memory namespace and one in the namespace accessed by all other subprotocols or 2) The first thread to open a database defines which subprotocols must be used to access the database from other connections--until the database is brought down. If a database was first opened by the memory subprotocol, then a database by that name cannot be accessed simultaneously by any other subprotocol. Conversely, if a database was first opened by the default or classpath subprotocols, then a database by that name cannot be accessed simultaneously by the memory subprotocol. I have two worries: A) We may not understand the current behavior of our subprotocols well enough. See DERBY-4172. B) The code may assume that there is only one namespace for databases. Adding another namespace may be tricky. I think I would lean toward (2). If we later decide that (2) is too restrictive and we think we understand the code well enough, then we could migrate to (1) without causing serious compatibility issues. I think that going from (1) to (2) will have serious compatibility implications. > Connections to on-disk db go to in-memory db if in-memory db with same name is booted > ------------------------------------------------------------------------------------- > > Key: DERBY-4171 > URL: https://issues.apache.org/jira/browse/DERBY-4171 > Project: Derby > Issue Type: Bug > Components: Store > Affects Versions: 10.5.1.1 > Reporter: Knut Anders Hatlen > Attachments: derby-4171-1a-fix.diff > > > When an in-memory database has been booted, subsequent attempts to connect to an ordinary (on-disk) database with the same name as the in-memory database will connect to the in-memory db. > ij version 10.5 > ij> connect 'jdbc:derby:memory:MyDB;create=true'; -- with subprotocol memory > ij> create table t (x varchar(30)); > 0 rows inserted/updated/deleted > ij> insert into t values 'This is the in-memory backend'; > 1 row inserted/updated/deleted > ij> connect 'jdbc:derby:MyDB;create=true'; --without subprotocol memory, should create disk db > WARNING 01J01: Database 'MyDB' not created, connection made to existing database instead. > ij(CONNECTION1)> select * from t; > X > ------------------------------ > This is the in-memory backend > 1 row selected -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.