Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 47868 invoked from network); 9 Apr 2010 04:41:25 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Apr 2010 04:41:25 -0000 Received: (qmail 70110 invoked by uid 500); 9 Apr 2010 04:41:25 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 70018 invoked by uid 500); 9 Apr 2010 04:41:23 -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 70011 invoked by uid 99); 9 Apr 2010 04:41:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Apr 2010 04:41:22 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.221.181] (HELO mail-qy0-f181.google.com) (209.85.221.181) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Apr 2010 04:41:16 +0000 Received: by qyk11 with SMTP id 11so2283755qyk.13 for ; Thu, 08 Apr 2010 21:40:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.79.74 with HTTP; Thu, 8 Apr 2010 21:40:54 -0700 (PDT) Date: Fri, 9 Apr 2010 14:40:54 +1000 Received: by 10.229.218.21 with SMTP id ho21mr356612qcb.79.1270788054825; Thu, 08 Apr 2010 21:40:54 -0700 (PDT) Message-ID: Subject: Copying an idle derby database that is currently open From: David Sitsky To: derby-user@db.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi all, I know this scenario is not recommended, but a couple of our customers had accidentally copied some Derby databases which were still opened by a program, however they claim the program had been idle for quite some time, so there should not have been any active transactions. I am curious to understand if this is true, is it still possible for database corruption to occur in the copied versions? If so, why? I can only guess Derby might be doing some background maintenance tasks (for example, a checkpoint?), and that somehow copying the files produced inconsistencies since files were changing as they were being copied, but I am only guessing. I wish we had the option (at least under Windows) to set the files open by Derby to be opened "exclusively", so that nobody can even open them for reading (and thus copy them). I guess if you "freeze" the database, you'd have to remove these exclusive locks until the database is thawed. A shame we can't do this in Java, or does NIO2 provide this? -- Cheers, David Nuix Pty Ltd Suite 79, 89 Jones St, Ultimo NSW 2007, Australia Ph: +61 2 9280 0699 Web: http://www.nuix.com Fax: +61 2 9212 6902