jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (JCR-2428) When adding nodes inside a given node on different sessions distributed on different threads it throws InvalidItemStateException
Date Wed, 16 Jun 2010 12:57:23 GMT

     [ https://issues.apache.org/jira/browse/JCR-2428?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jukka Zitting resolved JCR-2428.
--------------------------------

      Assignee: Jukka Zitting
    Resolution: Duplicate

The same problem was reported also later in JCR-2579. Since I already started working on JCR-2579,
I'll mark this issue as a duplicate.

Thanks for the test case and the background, it helps in figuring out how to fix this!

> When adding nodes inside a given node on different sessions distributed on different
threads it throws InvalidItemStateException
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JCR-2428
>                 URL: https://issues.apache.org/jira/browse/JCR-2428
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 1.6.0
>         Environment: Mac OS X 10.6 with JDK 1.5 (yes, I downgraded this)
>            Reporter: Luiz Fernando Teston
>            Assignee: Jukka Zitting
>         Attachments: MultithreadedSessionTest.java
>
>
> I just found an strange behavior while using multiple sessions on multi thread environment.
I'd like to know if I did something wrong. 
> My application code do this:
> 1 - before start to work, it creates a root node inside a new session. It saves and close
this session.
> 2 - create a bunch of workers. Each worker has its own session.
> 3 - each worker adds nodes inside the root node retrieved by its session. It saves and
do a logout properly.
> 4 - fill this workers on a list of Callables to be passed to an java 5 ThreadPoolExecutor.
> 5 - it executes all workers on the ThreadPool. 
> 6 - it do some asserts to verify if it gots some errors or not.
> During phase 5 it gots an exception telling this:
> javax.jcr.InvalidItemStateException: Item cannot be saved because it has been modified
externally: node /
> 	at org.apache.jackrabbit.core.ItemImpl.getTransientStates(ItemImpl.java:245)
> 	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:939)
> 	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:915)
> I just wrote a test to simulate this behavior. Sometimes it got this error sometimes
not. Also to be easy to simulate this error, just change the THREAD_SIZE and NODE_SIZE variables.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message