Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 74466 invoked from network); 8 Dec 2008 04:29:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Dec 2008 04:29:17 -0000 Received: (qmail 60090 invoked by uid 500); 8 Dec 2008 04:29:28 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 60071 invoked by uid 500); 8 Dec 2008 04:29:28 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 60060 invoked by uid 99); 8 Dec 2008 04:29:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Dec 2008 20:29:28 -0800 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [171.71.176.70] (HELO sj-iport-1.cisco.com) (171.71.176.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Dec 2008 04:29:13 +0000 X-IronPort-AV: E=Sophos;i="4.33,733,1220227200"; d="scan'208";a="114758488" Received: from sj-dkim-3.cisco.com ([171.71.179.195]) by sj-iport-1.cisco.com with ESMTP; 08 Dec 2008 04:28:51 +0000 Received: from sj-core-1.cisco.com (sj-core-1.cisco.com [171.71.177.237]) by sj-dkim-3.cisco.com (8.12.11/8.12.11) with ESMTP id mB84SowW029992; Sun, 7 Dec 2008 20:28:50 -0800 Received: from sj-webmail-15.cisco.com (sj-webmail-15.cisco.com [171.70.113.20]) by sj-core-1.cisco.com (8.13.8/8.13.8) with ESMTP id mB84Soob020695; Mon, 8 Dec 2008 04:28:50 GMT Received: from sj-webmail-15.cisco.com (localhost.localdomain [127.0.0.1]) by sj-webmail-15.cisco.com (8.13.1/8.13.1) with ESMTP id mB84SoW1010334; Sun, 7 Dec 2008 20:28:50 -0800 Received: from sj-webmail-15.cisco.com (root@localhost) by sj-webmail-15.cisco.com (8.13.1/8.13.1/Submit) with ESMTP id mB84SkJr010318; Sun, 7 Dec 2008 20:28:48 -0800 Received: from kaparamewxp01 (dhcp-10-77-7-199.cisco.com [10.77.7.199]) by sj-webmail-15.cisco.com (Scalix SMTP Relay 10.0.5.3) via ESMTP; Sun, 07 Dec 2008 20:28:46 -0800 (PST) Date: Mon, 8 Dec 2008 09:58:43 +0530 From: Kamesh Parameswaran To: "'Emmanuel Cecchet'" cc: Message-ID: <030f01c958ed$7582f560$c7074d0a@cisco.com> In-Reply-To: <493A9147.8090009@frogthinker.org> References: <02fe01c9578d$270d7b50$c7074d0a@cisco.com> References: <493A9147.8090009@frogthinker.org> Subject: RE: Urgent : Problem in booting up the database using Derby x-scalix-Hops: 1 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 Thread-Index: AclXshhIidqUJmK4TCi2uVjq9OsPpABOucEw MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Disposition: inline DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=7848; t=1228710530; x=1229574530; c=relaxed/simple; s=sjdkim3002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=kaparame@cisco.com; z=From:=20Kamesh=20Parameswaran=20 |Subject:=20RE=3A=20Urgent=20=3A=20Problem=20in=20booting=2 0up=20the=20database=20using=20Derby |Sender:=20; bh=4old+/uAChgfaifToUgrITdmapwUulIDyUywkhNaRPY=; b=EKeb1khW6DMox9+iqF1ERLu7bKHP7Hx84LrIMQyh0GX2s7EZ11fmd9FNj9 sVtU5GzWeb353PZyCPIMfXIwEuBTKzcPgexbbMdJKu/0BoKBMYn00vHGqo0L 9V2tuodbGJ; Authentication-Results: sj-dkim-3; header.From=kaparame@cisco.com; dkim=pass ( sig from cisco.com/sjdkim3002 verified; ); X-Virus-Checked: Checked by ClamAV on apache.org Emanuel, I could see the database and the instance of Derby get shutting down. I've tried by giving my database URL too. But the result is same though. DriverManager.getConnection("jdbc:derby:;shutdown=true"); is used to shutdown the entire system of Derby (Derby+Database). Please correct me If I'm wrong. Because I've tried all the combinations and couldn't achieve the result which I expect. Thanks, Kamesh -----Original Message----- From: Emmanuel Cecchet [mailto:manu@frogthinker.org] Sent: Saturday, December 06, 2008 8:21 PM To: Derby Discussion Cc: kaparame@cisco.com Subject: Re: Urgent : Problem in booting up the database using Derby Kamesh, > I'm suffering a weird kind of a problem while running my JUnit Test > Cases against a database which uses derby as an engine. > Once after each test case gets completed I'm shutting down the > database and derby using the following piece of code > > DriverManager.getConnection("jdbc:derby:;shutdown=true"); Are you not supposed to provide the database name in the URL? It looks like it is missing here. Emmanuel > > I'm running a batch of test cases at a fly using the JUnit option > available in Apache ANT, from Command Line mode. There are eleven test > cases in my Batch. Since my test cases make use of hibernate to boot > up derby as well as the database, I don't have to worry about starting > it up. It is done in embedded mode. I have to be worried about > shutting down the derby instance and db properly. The problem is, the > first 3 test cases start up and shutdown the derby and db properly, > but when the fourth test case tries to boot up the db I'm getting the > following error , > > ====================================================================== > ============================================= > 2008-12-06 05:24:47.154 GMT > Thread[com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2 > ,5,main] > Cleanup action starting > *java.sql.SQLException: Failed to start database ., see the > next exception for details. > * at > org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown > Source) > at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown > Source) at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown > Source) at > org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown > Source) > at org.apache.derby.impl.jdbc.EmbedConnection.(Unknown Source) > at org.apache.derby.impl.jdbc.EmbedConnection30.(Unknown Source) > at org.apache.derby.jdbc.Driver30.getNewEmbedConnection(Unknown > Source) at org.apache.derby.jdbc.InternalDriver.connect(Unknown > Source) at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown > Source) at > com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManage > rDataSource.java:81) > at > com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnectio > n(WrapperConnectionPoolDataSource.java:96) > at > com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.acquireResource(C3 > P0PooledConnectionPool.java:89) > at > com.mchange.v2.resourcepool.BasicResourcePool.acquireUntil(BasicResour > cePool.java:665) > at > com.mchange.v2.resourcepool.BasicResourcePool.access$500(BasicResource > Pool.java:32) > at > com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicRes > ourcePool.java:1204) > at > com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(Threa > dPoolAsynchronousRunner.java:368) *Caused by: java.sql.SQLException: > Another instance of Derby may have already booted the > database..* at > org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown > Source) > at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown > Source) ... 13 more *Caused by: ERROR XSDB6: Another instance of > Derby may have already booted the database .* at > org.apache.derby.iapi.error.StandardException.newException(Unknown > Source) > at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory.privGetJBMSLo > ckOnDB(Unknown > Source) > at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory.run(Unknown > Source) > at java.security.AccessController.doPrivileged(Native Method) at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory.getJBMSLockOn > DB(Unknown > Source) > at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory.boot(Unknown > Source) > at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown > Source) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown > Source) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown > Source) > at > org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unkno > wn > Source) > at org.apache.derby.impl.store.raw.RawStore.boot(Unknown Source) at > org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown > Source) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown > Source) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown > Source) > at > org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unkno > wn > Source) > at org.apache.derby.impl.store.access.RAMAccessManager.boot(Unknown > Source) > at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown > Source) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown > Source) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown > Source) > at > org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Unkno > wn > Source) > at org.apache.derby.impl.db.BasicDatabase.bootStore(Unknown Source) > at org.apache.derby.impl.db.BasicDatabase.boot(Unknown Source) at > org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown > Source) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown > Source) > at > org.apache.derby.impl.services.monitor.BaseMonitor.bootService(Unknown > Source) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startProviderServic > e(Unknown > Source) > at > org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStar > tService(Unknown > Source) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentServ > ice(Unknown > Source) > at > org.apache.derby.iapi.services.monitor.Monitor.startPersistentService( > Unknown > Source) > ... 13 more > > ====================================================================== > ============================================== > > > > > But the third test case has shutdown the db as well as the derby.. The > hibernate log shows, > > *2008-12-06 10:55:52,169 ERROR [main] (JDBCExceptionReporter.java:78) > - Connections could not be acquired from the underlying database!* > ** > ** > ** > I've totally no idea about what is going inside the derby. If it is > able to start it up and shut it down for three consecutive times then > why its not able to do the same for the upcoming runs. The starting up > and shutting down is done internally in the test case , and the test > cases are run in a batch mode using JUnit. So no way I'm stopping the > tests in the middle. Derby and database have to be started up and > shutdown 11 times consecutively since I've 11 cases in my JUnit task. > If anyone could shed some lights on the issue it'd be helpful for me > to proceed further. > > > Thanks in Advance, > > Kamesh P G. -- Emmanuel Cecchet FTO @ Frog Thinker Open Source Development & Consulting -- Web: http://www.frogthinker.org email: manu@frogthinker.org Skype: emmanuel_cecchet