From derby-user-return-14470-apmail-db-derby-user-archive=db.apache.org@db.apache.org Fri Jul 13 18:40:15 2012 Return-Path: X-Original-To: apmail-db-derby-user-archive@www.apache.org Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D4092D683 for ; Fri, 13 Jul 2012 18:40:15 +0000 (UTC) Received: (qmail 82043 invoked by uid 500); 13 Jul 2012 18:40:15 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 82010 invoked by uid 500); 13 Jul 2012 18:40:15 -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 82001 invoked by uid 99); 13 Jul 2012 18:40:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jul 2012 18:40:15 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [98.139.44.134] (HELO nm7.access.bullet.mail.sp2.yahoo.com) (98.139.44.134) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 13 Jul 2012 18:40:05 +0000 Received: from [98.139.44.102] by nm7.access.bullet.mail.sp2.yahoo.com with NNFMP; 13 Jul 2012 18:39:42 -0000 Received: from [98.139.44.69] by tm7.access.bullet.mail.sp2.yahoo.com with NNFMP; 13 Jul 2012 18:39:42 -0000 Received: from [127.0.0.1] by omp1006.access.mail.sp2.yahoo.com with NNFMP; 13 Jul 2012 18:39:42 -0000 X-Yahoo-Newman-Id: 509947.85388.bm@omp1006.access.mail.sp2.yahoo.com Received: (qmail 78139 invoked from network); 13 Jul 2012 18:39:42 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=sbcglobal.net; h=DKIM-Signature:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type; b=OFqZ1qT8YxfmeeU3EnyvtAy+GAnKPavc3lLBVBkbvmUYEbq0tWPUZX/fuUAm6p94Izyp76FPi2ikMY3jBf380yuMFWiJEoGePu4UrPZO8oWwUCfn0lcm+EJqBhAo8p8iVqnw7pF5xgBd816J6ICquTwtWYM4gT80OIikrM8Fp3A= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sbcglobal.net; s=s1024; t=1342204782; bh=tGG37DOaMwpgLM1ZtzTOPTffvFeIbP9KMxkjKvhMyxk=; h=X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type; b=A7RSWh6i2lxZwLvOK/WKP3b5fmwsdwiA86ca95Pn/RFL8jHzwGaOi2XLAIELKEa3+0DFmU6glfpY095u1pCB5z3TXSxijlC0NGto8C8S11AzEaegC6TpQLc7j6h0qTrJrKX5SSb/m3VkD+3BtJor2Ja7mCZUPiCYdRegtiRurus= X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: m6ttnuoVM1n.IX6yYerGw7ggX1nIZit51VhGnmPT95FQFhz Vn5rfAz.JESrySzfIQVnoGrHBzAyL9_O.qUI57tyk0uLBIJiaHLJ07zQfEST GLH_oQEjL3luBGdHuZ6J_RY0qn.pplS7J4Au5ryEoTjUcBE.WlgUhzbUNyTi tE33lcrhAFC1vN3xRMNSWiuUkJNhxBeMzE4XHljqlZfdtkohmt5Jy9ExPR51 SjOQCCfqLcBVTB7xoFseMZa7P4ADiys89OZlbgltgVZDGC9SYy4WaPOaLbB3 DoEr2XvoYgm9ba6ADWYPmCTa5eEToDd5CpDIwCH..8zFEUshvdinQIAdiifG O6UwK7MUE.TsPSTipxlmfEFwt2Hc_TO_Ri.h8EBihtJ4Od6eqHyapGRM1XnX 29Gy0u7osW89H7_Ma1Tk.lEi1oWlFhZlV3_Bnuxzngv3hsltHk4RN482QfHd zIo_eDTrjEYSrxfAr7zlRhIx3yPCkZQWOVw3bqanzJusfsPeIZQpVFY8uxyG qI4azVV0uxNmn5bhXWThyy6DIzb.qL.hRvbWKHneY5TA- X-Yahoo-SMTP: fBd8VESswBBwVkX.d9lIdXduzED_6kJxUAzIjM21tL._95FbORG0yg-- Received: from [192.168.1.71] (kmarsdenderby@108.231.78.45 with plain) by smtp109.sbc.mail.gq1.yahoo.com with SMTP; 13 Jul 2012 11:39:41 -0700 PDT Message-ID: <50006B61.703@sbcglobal.net> Date: Fri, 13 Jul 2012 11:39:29 -0700 From: Katherine Marsden User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: Derby Discussion Subject: Re: Disconnecting Derby and TDD References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------070204060206030905020002" This is a multi-part message in MIME format. --------------070204060206030905020002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 7/11/2012 10:14 PM, Matthew Hauck wrote: > > I am writing about the well known error: "Failed to start database > '...' with class loader ..." I realize that you cannot have two > simultaneous connections from two different JVMs to a derby embedded > database. My question is whether or not it is possible to disconnect / > "unload" / "unboot" one connection in order to load up the other one, > etc. Or does the first JVM have to entirely stop before the next one > can make a connection? > > I ask for TDD reasons. One of the tests I'm trying to write (on > cucumber / jruby) requires some out-of-process testing. i.e. I have > one process (cucumber) invoking the tests, which requires the spawning > of another process. I would like the parent process to be able to turn > off its connection to the embedded database (without shutting down), > such that it can allow the spawned process to access the database, and > then turn it back on and make sure things went as planned after the > other process completes. > > Is this possible? > You can shutdown a single database without exiting the JVM using the shudown=true attribute if using a DriverManager connection: http://db.apache.org/derby/docs/10.9/ref/rrefattrib16471.html or with the DataSource property shutdownDatabase() http://db.apache.org/derby/docs/10.9/publishedapi/jdbc4/org/apache/derby/jdbc/EmbeddedDataSource40.html This will allow another jvm to boot the database. Then then after the spawned process completes, first jvm can reconnect which will reboot the database. Best Kathey --------------070204060206030905020002 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 7/11/2012 10:14 PM, Matthew Hauck wrote:

I am writing about the well known error: "Failed to start database '...' with class loader ..."  I realize that you cannot have two simultaneous connections from two different JVMs to a derby embedded database. My question is whether or not it is possible to disconnect / "unload" / "unboot" one connection in order to load up the other one, etc. Or does the first JVM have to entirely stop before the next one can make a connection?

I ask for TDD reasons. One of the tests I'm trying to write (on cucumber / jruby) requires some out-of-process testing. i.e. I have one process (cucumber) invoking the tests, which requires the spawning of another process. I would like the parent process to be able to turn off its connection to the embedded database (without shutting down), such that it can allow the spawned process to access the database, and then turn it back on and make sure things went as planned after the other process completes.

Is this possible?

You can shutdown a single database without exiting the JVM using the shudown=true  attribute if using a DriverManager connection:
http://db.apache.org/derby/docs/10.9/ref/rrefattrib16471.html
or with the DataSource property shutdownDatabase()
http://db.apache.org/derby/docs/10.9/publishedapi/jdbc4/org/apache/derby/jdbc/EmbeddedDataSource40.html


This will allow another jvm to boot the database. Then then after the spawned process completes,  first jvm can reconnect which will  reboot the database.

Best

Kathey
--------------070204060206030905020002--