[
https://issues.apache.org/jira/browse/JCR-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665377#action_12665377
]
Alexander Klimetschek commented on JCR-1939:
--------------------------------------------
The InvalidItemStateException in this case is perfectly normal for the JCR API,
since both threads are simultanously adding nodes to the same parent, which
must be synchronized on the client. Jackrabbit does not try to "merge" these
conflicting operations, but notifies the client via the
InvalidItemStateException instead.
See Item.save()/Session.save():
http://day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Item.html#save() :
Throws
InvalidItemStateException - if any of the changes to be persisted conflicts
with a change already persisted through another session and the implementation
is such that this conflict can only be detected at save-time and therefore was
not detected earlier, at change-time.
> If we threading to add nodes into the repository
> ------------------------------------------------
>
> Key: JCR-1939
> URL: https://issues.apache.org/jira/browse/JCR-1939
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Affects Versions: 1.5.0
> Environment: Microsoft windows XP professional, 2GB ram
> Reporter: akil ajani
> Assignee: Jukka Zitting
> Fix For: 1.5.0
>
>
> Senario 1:
> we have a root node and it has 1 parent node. i am trying to add 600 nodes to
> that parent node. so i have created 3 threads and each thread is adding 200
> nodes. it works for some time and later on throws an exception
> java.util.ConcurrentModificationException
> at java.util.HashMap$HashIterator.nextEntry(HashMap.java:787)
> at java.util.HashMap$ValueIterator.next(HashMap.java:817)
> at
> java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1010)
> at
> org.apache.jackrabbit.core.state.SessionItemStateManager.getDescendantTransientItemStates(SessionItemStateManager.java:376)
> at
> org.apache.jackrabbit.core.ItemImpl.getTransientStates(ItemImpl.java:361)
> at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1079)
> at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849)
> some time it gets HANGED
> Scenario:2
> we have a root node and it has 2 parent node. i am trying to add 600 nodes to
> eac parent node. so i have created 2 threads and each thread is adding 600
> nodes to cach parent node. it works for some time and later on throws an
> exception
> java.util.ConcurrentModificationException
> at java.util.HashMap$HashIterator.nextEntry(HashMap.java:787)
> at java.util.HashMap$ValueIterator.next(HashMap.java:817)
> at
> java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1010)
> at
> org.apache.jackrabbit.core.state.SessionItemStateManager.getDescendantTransientItemStates(SessionItemStateManager.java:376)
> at
> org.apache.jackrabbit.core.ItemImpl.getTransientStates(ItemImpl.java:361)
> at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1079)
> at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:849)
> some time it gets HANGED
> please help me to resolve this issue as soon as possible. i would be thankful
> to you if you could provide me the solution for this as soon as possible
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.