Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 86230 invoked from network); 18 May 2007 15:51:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 May 2007 15:51:40 -0000 Received: (qmail 51668 invoked by uid 500); 18 May 2007 15:51:43 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 51452 invoked by uid 500); 18 May 2007 15:51:43 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 51434 invoked by uid 99); 18 May 2007 15:51:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 08:51:43 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 May 2007 08:51:36 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 7C035714071 for ; Fri, 18 May 2007 08:51:16 -0700 (PDT) Message-ID: <21052758.1179503476505.JavaMail.jira@brutus> Date: Fri, 18 May 2007 08:51:16 -0700 (PDT) From: "Stefan Guggisberg (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Created: (JCR-933) RepositoryImpl.acquireRepositoryLock() fails to detect that the file lock is already held by the current process MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org RepositoryImpl.acquireRepositoryLock() fails to detect that the file lock is already held by the current process ---------------------------------------------------------------------------------------------------------------- Key: JCR-933 URL: https://issues.apache.org/jira/browse/JCR-933 Project: Jackrabbit Issue Type: Bug Components: core Environment: java 1.4 & 1.5 on *nix-based platforms. (verfied with java 1.4 on mac os-x 10.4.9) Reporter: Stefan Guggisberg Priority: Critical Fix For: 1.4 with java 1.4 and 1.5 on a *nix-based platform it is possible to (concurrently) instantiate more than one repository instance in the same jvm based on same/identical configurations. this is a critical issue since it might lead to data corruption. the issue only exists with java versions prior to 1.6 and *nix-based platforms (only verified on mac os-x 10.4). note that the issue does not exist when the file lock is held by another jvm. code snippet to reproduce the issue: Repository rep1 = new TransientRepository(); Session s1 = rep1.login(new SimpleCredentials("johndoe", "".toCharArray())); Repository rep2 = new TransientRepository(); Session s2 = rep2.login(new SimpleCredentials("johndoe", "".toCharArray())); the root problem is the incorrect behavior of java.nio.channels.FileChannel#tryLock() which is demonstrated by the following code snippet: try { FileLock fl1 = new FileOutputStream("foo").getChannel().tryLock(); System.out.println("1st lock: " + fl1); FileLock fl2 = new FileOutputStream("foo").getChannel().tryLock(); System.out.println("2nd lock: " + fl2); } catch (Throwable t) { t.printStackTrace(); } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.