Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 78539 invoked from network); 26 Feb 2008 11:23:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2008 11:23:23 -0000 Received: (qmail 36505 invoked by uid 500); 26 Feb 2008 11:23:16 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 36482 invoked by uid 500); 26 Feb 2008 11:23:16 -0000 Mailing-List: contact users-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@jackrabbit.apache.org Delivered-To: mailing list users@jackrabbit.apache.org Received: (qmail 36473 invoked by uid 99); 26 Feb 2008 11:23:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 03:23:16 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mittspamkonto@gmail.com designates 72.14.204.228 as permitted sender) Received: from [72.14.204.228] (HELO qb-out-0506.google.com) (72.14.204.228) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Feb 2008 11:22:41 +0000 Received: by qb-out-0506.google.com with SMTP id p36so3066210qba.13 for ; Tue, 26 Feb 2008 03:22:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=On6292SVtdT6kr87MOmNuNg/wqSY9z9DYKrlXN/6Tu0=; b=SL+q+sV1BEpXDYbtE7NNtu6pMmLAfuxVB7XVgEVecvuVc9HbUZu8PSy2BbFdt1z8wKcnEes6j+rEUy3LAoQkoWgRWJw3vkwXsu4BFQ6AFzyEj8HxS5nliGuyLYiSHJuVuoQjy1mdrStNqtqz1yh2T451n+Po1WEr8t+6TAbW4as= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=jiRXgWIqwRjEL4gaKNtQ5vVVrn/J7b6GNZj+z+ZLP5J7l2/xDPP6xJk8d2FEMnrKWA5O9VAkeTPVm0QfGqjwBsmg2whIb+KLKYff9L/5n7ZID1YIkKk8yRz1JHPqq23sz+frRhnHcFIjgo01XvRcjeY8dPsNj2nah0fQNmJ/5Uk= Received: by 10.140.126.14 with SMTP id y14mr1034993rvc.96.1204024969400; Tue, 26 Feb 2008 03:22:49 -0800 (PST) Received: by 10.141.122.17 with HTTP; Tue, 26 Feb 2008 03:22:49 -0800 (PST) Message-ID: <2c7d5a310802260322x3f70f9cn10db6c043f1cb5c6@mail.gmail.com> Date: Tue, 26 Feb 2008 12:22:49 +0100 From: "Foo Bar" To: users@jackrabbit.apache.org Subject: Concurrent access problems MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org Hi. I have just made my first attempt to use Jackrabbit in a bigger project, and I'm having problems with concurrent access. I'm using jackrabbit 1.4 with the example repository.xml in JBoss 4.2.2.GA. The first test I made is simple. I tried to change an implementation that currently uses a filesystem to store files to use jackrabbit. Users upload files, these get unique id:s and I save them in a flat directory: root | files |-1 |-2 |-3 etc.. Each file-node is created according to the recipe at http://wiki.apache.org/jackrabbit/ExamplesPage (jcr:content subnode etc). The save is as simple as possible; I get the session, create the file subnode with binary content and logout. The id:s are fetched from a db (auto-increment), so they are unique across transactions. The saving works fine, until I start hitting the page with a few (tenths of) simultaneous uploads. I then get validation exceptions, telling me about conflicting changes: javax.jcr.InvalidItemStateException: 6570ddc8-29a7-4335-a9ca-76dc98687d22: the item cannot be saved because it has been modified externally. at org.apache.jackrabbit.core.ItemImpl.getTransientStates(ItemImpl.java:378) at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1083) at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:896) at org.apache.jackrabbit.jca.JCASessionHandle.save(JCASessionHandle.java:178) I've read the discussion here: http://www.nabble.com/Problem-in-Multithreaded-Environment-td14779040.html (nabble is down, google cache here: http://66.102.9.104/search?q=cache:jqbwF-fsAjoJ:www.nabble.com/Problem-in-Multithreaded-Environment-td14779040.html) This discussion, together with the issue at http://issues.apache.org/jira/browse/JCR-584 basically says that it should be ok to have several sessions concurrently adding subnodes to a node, without any problems. The JIRA issue only explicitly says that two sessions concurrently can add subnodes, and I assumed this to be valid for any number of sessions. Is this a correct assumption? Is there anything I should keep in mind when trying to make this work? Any properties who need to be set on nodes or in workspace? Any save order that might cause problems? I'm having trouble reproducing the problem in unit tests, so any hints as to why this is happening would be greatly appreciated. I don't really see serializing access as an option, since the plan is to have many concurrent saves. I therefore ruled out locks. Is it true that locks always imply serial access? Regards Alexander