Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 47836 invoked from network); 29 Jun 2006 09:45:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 09:45:36 -0000 Received: (qmail 17486 invoked by uid 500); 29 Jun 2006 09:45:35 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 17456 invoked by uid 500); 29 Jun 2006 09:45:35 -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 17447 invoked by uid 99); 29 Jun 2006 09:45:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 02:45:35 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.124.179.102] (HELO polatsk.objectstyle.org) (64.124.179.102) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 29 Jun 2006 02:45:34 -0700 Received: (qmail 11933 invoked from network); 29 Jun 2006 09:45:09 -0000 Received: from unknown (HELO ?j??@N???????????IPv6:::1?) (127.0.0.1) by localhost with SMTP; 29 Jun 2006 09:45:09 -0000 Mime-Version: 1.0 (Apple Message framework v750) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <6A8A4375-8379-45A0-8358-341F2665682D@objectstyle.org> Cc: manyi.lu@sun.com Content-Transfer-Encoding: 7bit From: Andrus Adamchik Subject: Derby as desktop database Date: Thu, 29 Jun 2006 10:45:07 +0100 To: derby-dev@db.apache.org X-Mailer: Apple Mail (2.750) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I've been looking for some time for a good embedded database that would work for desktop applications. Derby is ideal for that and I am starting to use it more and more in various examples and tutorials that I am writing for Cayenne. But there is one feature that I am missing in Derby (or any other database for that matter) - an ability to share the same database between multiple desktop applications (or multiple VM instances of the same Java application). I asked this question the Derby folks from Sun at ApacheCon in Dublin the other day and the answer was basically - run the network server. In other words db sharing and embedded mode are not compatible. So I wonder what it would take to make it compatible? Since we are talking desktop apps, the following conditions are at play: (a) all apps run on the same machine (but in different VMs) (b) usually only one instance at a time would work with the database, but other instances can occasionally access the db in the background (no need to deal with massive concurrency) (c) usually the database is small-to-medium size. Any ideas? One possible solution is cloning the DB for each instance and using multicast for peer-to-peer synchronization. Another (more promising) is to do collaborative peer-to-peer connection pool (DataSource), so that when a client needs a local Derby connection it sends a multicast so that current lock owner in a different VM can finish its thing, shutdown Derby and release the lock. I wonder if anyone has done that already? Andrus ------------------------------ Andrus (aka Andrei) Adamchik Cayenne Persistence Framework Creator, Committer http://incubator.apache.org/projects/cayenne.html