Return-Path: Delivered-To: apmail-jackrabbit-users-archive@locus.apache.org Received: (qmail 31814 invoked from network); 13 Jan 2008 23:41:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jan 2008 23:41:44 -0000 Received: (qmail 20760 invoked by uid 500); 13 Jan 2008 23:41:32 -0000 Delivered-To: apmail-jackrabbit-users-archive@jackrabbit.apache.org Received: (qmail 20728 invoked by uid 500); 13 Jan 2008 23:41:32 -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 20719 invoked by uid 99); 13 Jan 2008 23:41:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jan 2008 15:41:32 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of stefko.ivanov@gmail.com designates 72.14.220.159 as permitted sender) Received: from [72.14.220.159] (HELO fg-out-1718.google.com) (72.14.220.159) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Jan 2008 23:41:05 +0000 Received: by fg-out-1718.google.com with SMTP id l27so2492735fgb.43 for ; Sun, 13 Jan 2008 15:41:09 -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:in-reply-to:mime-version:content-type:references; bh=qTJyt1bLh432SHTxHV7Nznn3e98yFME85ZMiBfw2KTs=; b=gpjbq1dZtKnTUlsxQc+IY9DZ84rrFokum1sMplgaqjyhQSon7dJG0gsFLNRdnP0LAxmMsP0C41wfA1GqJE0kqKR0kmD4DyGg3M/V/HaQm+0fZhctiM3HxRQuoKW5Aao38HuIRYYFgPZwd9e651TOj0BiPboZ8hyv+hXDIFb81vk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=GkIUcmHdBzxEU1t95A9KKQwWMpJXYc8t1qMic2BKOGgHeO7+0HGMKTezQU+3MBavW+VmXVn2u9djUXZjIcYqO2HxO9VkKW9v6XVJC0eQSC9pL5WJUENOSlLDtZQBBagq6W4C2y2JrEjUZg+hhhpTJPfxccvSed09JASmvqBUk7I= Received: by 10.82.107.15 with SMTP id f15mr9848928buc.0.1200267668068; Sun, 13 Jan 2008 15:41:08 -0800 (PST) Received: by 10.82.146.17 with HTTP; Sun, 13 Jan 2008 15:41:07 -0800 (PST) Message-ID: Date: Mon, 14 Jan 2008 00:41:07 +0100 From: "Stefan Ivanov" To: users@jackrabbit.apache.org Subject: Re: Problem in Multithreaded Environment In-Reply-To: <47892EF1.5070208@mulesource.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7180_25985827.1200267667479" References: <47892E85.8020201@mulesource.com> <47892EF1.5070208@mulesource.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_7180_25985827.1200267667479 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Dan I have the same problem. I tried this with Local and XA Transaction Manager but still ... :-( I use 1.3.3 and at the moment I'm happier with the Local Transaction Manager. I've done different things to avoid this: reorganization of the data structure tree, unique node names but the problem is still here. Stefan 2008/1/12, Dan Diephouse : > > Dan Diephouse wrote: > > Heya, I think I'm probably doing something pretty stupid here, but I'm > > having a few problems using Jackrabbit in a multithreaded environment. > > If you can imagine I have this scenario: > > > > Thread #1 running inside my unit test which is doing stuff to the > > repository all in one session. > > Thread #2 which is reading stuff inside the repository and updating > > some nodes > > > > I think occasionally these threads collide though and start modifying > > the same node. Then I starting getting things like: > > > > javax.jcr.RepositoryException: failed to create transient state: > > there's already a property state instance with id > > 1d038015-6c48-4654-a685-1dcf57a6bf6f/{ > http://www.jcp.org/jcr/1.0}mixinTypes: > > there's already a property state instance with id > > 1d038015-6c48-4654-a685-1dcf57a6bf6f/{ > http://www.jcp.org/jcr/1.0}mixinTypes > > > > at > > org.apache.jackrabbit.core.PropertyImpl.getOrCreateTransientItemState( > PropertyImpl.java:97) > > > > at > > org.apache.jackrabbit.core.PropertyImpl.restoreTransient( > PropertyImpl.java:143) > > > > at > > org.apache.jackrabbit.core.ItemImpl.restoreTransientItems(ItemImpl.java > :734) > > > > at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1233) > > at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849) > > ... > > Caused by: org.apache.jackrabbit.core.state.ItemStateException: > > there's already a property state instance with id > > 1d038015-6c48-4654-a685-1dcf57a6bf6f/{ > http://www.jcp.org/jcr/1.0}mixinTypes > > > > at > > > org.apache.jackrabbit.core.state.SessionItemStateManager.createTransientPropertyState > (SessionItemStateManager.java:629) > > > > at > > org.apache.jackrabbit.core.PropertyImpl.getOrCreateTransientItemState( > PropertyImpl.java:90) > > > > ... 42 more > > > > Or: > > > > javax.jcr.RepositoryException: failed to create transient state: > > there's already a property state instance with id > > 1d038015-6c48-4654-a685-1dcf57a6bf6f/{http://www.jcp.org/jcr/1.0}uuid: > > there's already a property state instance with id > > 1d038015-6c48-4654-a685-1dcf57a6bf6f/{http://www.jcp.org/jcr/1.0}uuid > > at > > org.apache.jackrabbit.core.PropertyImpl.getOrCreateTransientItemState( > PropertyImpl.java:97) > > > > at > > org.apache.jackrabbit.core.PropertyImpl.restoreTransient( > PropertyImpl.java:143) > > > > at > > org.apache.jackrabbit.core.ItemImpl.restoreTransientItems(ItemImpl.java > :734) > > > > at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1233) > > at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849) > > .... > > Caused by: org.apache.jackrabbit.core.state.ItemStateException: > > there's already a property state instance with id > > 1d038015-6c48-4654-a685-1dcf57a6bf6f/{http://www.jcp.org/jcr/1.0}uuid > > at > > > org.apache.jackrabbit.core.state.SessionItemStateManager.createTransientPropertyState > (SessionItemStateManager.java:629) > > > > at > > org.apache.jackrabbit.core.PropertyImpl.getOrCreateTransientItemState( > PropertyImpl.java:90) > > > > ... 42 more > > > > If the second thread was accessing a node created by the first thread > > and the node wasn't saved yet, would that explain these errors? > > > > Any ideas how to avoid this??? > > > > One other thing. Those exceptions are from thread #2. I get this > exception from thread #1: > > org.springframework.dao.ConcurrencyFailureException: Invalid item state; > nested exception is javax.jcr.InvalidItemStateException: /activities: > the node cannot be saved because it has been modified externally. > > Caused by: javax.jcr.InvalidItemStateException: /activities: the node > cannot be saved because it has been modified externally. > at org.apache.jackrabbit.core.NodeImpl.makePersistent(NodeImpl.java > :969) > at > org.apache.jackrabbit.core.ItemImpl.persistTransientItems(ItemImpl.java > :687) > at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1198) > at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849) > > Cheers, > - Dan > > -- > Dan Diephouse > MuleSource > http://mulesource.com | http://netzooid.com/blog > > ------=_Part_7180_25985827.1200267667479--