Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 94966 invoked from network); 9 Aug 2007 15:09:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Aug 2007 15:09:26 -0000 Received: (qmail 88444 invoked by uid 500); 9 Aug 2007 15:09:23 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 88422 invoked by uid 500); 9 Aug 2007 15:09:22 -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 88411 invoked by uid 99); 9 Aug 2007 15:09:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 08:09:22 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.18.1.36] (HELO gmp-ea-fw-1.sun.com) (192.18.1.36) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2007 15:09:17 +0000 Received: from d1-emea-09.sun.com (d1-emea-09.sun.com [192.18.2.119]) by gmp-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l79F8u3E013522 for ; Thu, 9 Aug 2007 15:08:56 GMT Received: from conversion-daemon.d1-emea-09.sun.com by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JMI00A01I22UW00@d1-emea-09.sun.com> (original mail from John.Embretsen@Sun.COM) for derby-user@db.apache.org; Thu, 09 Aug 2007 16:08:56 +0100 (BST) Received: from [129.159.112.236] by d1-emea-09.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JMI003AXI2VXOC4@d1-emea-09.sun.com> for derby-user@db.apache.org; Thu, 09 Aug 2007 16:08:55 +0100 (BST) Date: Thu, 09 Aug 2007 17:07:14 +0200 From: John Embretsen Subject: Re: Embedded or Network Framework? In-reply-to: <12073857.post@talk.nabble.com> Sender: John.Embretsen@Sun.COM To: Derby Discussion Reply-to: Derby Discussion Message-id: <46BB2DA2.60503@Sun.COM> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <000601c7da8d$d59e1720$0e64a8c0@synapseteja> <59c2e1ec0708090734x19ad45f5n825ec6fe67eab87e@mail.gmail.com> <12073857.post@talk.nabble.com> User-Agent: Thunderbird 2.0.0.0 (X11/20070419) X-Virus-Checked: Checked by ClamAV on apache.org Teja wrote: > Can someone confirm this: > > In my java app, on startup or so, I 'load' the embedded derby driver, so the > database is ready to be used by the java app. But I also launch the web > server (separate thread) through the same app, so the web server is still > running in the same JVM(?). Yes. > And then there is a web app which accesses teh database (through the web > server ofcourse (?)). > So in my web app database classes, can I just ignore the 'load' driver > line.. Class.forName(..); and proceed directly with the embedded connection > urls to access the db tables? I would think so, unless there is some complex classloading trickery going on here... Why not just try and see ;) > Note that at any given time, both the web app and java app will be accessing > the same database. In such scenario, can someone confirm that there will be > no data corruption and Embedded framework will take care of transactional > safety and such? As long as the DB is accessed from the same JVM, you should be safe from this particular issue. If you are using a relatively new JVM and a relatively new Derby version, I think there are mechanisms in place to prevent you from booting the same DB in more than one JVM at once. >> On 8/9/07, Teja Palla wrote: >>> So my question is, what framework needs to be used? will embedded >>> framework suffice because I see only one JVM here? Please advise.. I think embedded will suffice. Also, with embedded you avoid the overhead of sending network traffic back and forth to the database server. If, at a later stage, you find out that you need to connect to the database from multiple JVMs, you can always extend using an embedded server (see [1] for an explanation) instead, or a standalone server for that matter. -- John [1]: http://db.apache.org/derby/papers/DerbyTut/ns_intro.html#Embedded+Server