You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Marcin Nowak <ma...@comarch.com> on 2006/11/03 13:29:51 UTC
Adding nodes at the same time in two different sessions
Hi,
When adding nodes to the repository in two simultaneously threads and
sessions at the same time I get this:
javax.jcr.InvalidItemStateException: /: the item cannot be saved because it
has been modified externally.
at
org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerO
bject.java:104)
at
org.apache.jackrabbit.rmi.server.ServerSession.save(ServerSession.java:213)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown
Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at org.apache.jackrabbit.rmi.server.ServerSession_Stub.save(Unknown
Source)
at
org.apache.jackrabbit.rmi.client.ClientSession.save(ClientSession.java:207)
nodes are referencable but not versionable - test involved adding 20 nodes
in two sessions(10 nodes in one session) each in another thread at the same
time to an empty repository, first we've created parent node ('a' in session
one and 'b' in session two) and than we've putted there 10 nodes with
different names (10 to node 'a' for session one and another 10 to node 'b'
for session two) and it generates exception.
BR,
Marcin Nowak
--
Empowering business
http://webinars.comarch.com
Re: Adding nodes at the same time in two different sessions
Posted by Stefan Guggisberg <st...@gmail.com>.
hi marcin,
this has been discussed before, see e.g.
http://www.nabble.com/Concurrent-writing-to-a-JCR-repository-tf2363097.html#a6588868
there's also a jira issue that proposes an improvement wrt concurrent
modifications
of the same node:
http://issues.apache.org/jira/browse/JCR-584
cheers
stefan
On 11/3/06, Marcin Nowak <ma...@comarch.com> wrote:
> Hi,
>
> When adding nodes to the repository in two simultaneously threads and
> sessions at the same time I get this:
>
> javax.jcr.InvalidItemStateException: /: the item cannot be saved because it
> has been modified externally.
> at
> org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerO
> bject.java:104)
> at
> org.apache.jackrabbit.rmi.server.ServerSession.save(ServerSession.java:213)
> at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
> at sun.rmi.transport.Transport$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Unknown Source)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
> at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown
> Source)
> at java.lang.Thread.run(Unknown Source)
> at
> sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown
> Source)
> at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
> at sun.rmi.server.UnicastRef.invoke(Unknown Source)
> at org.apache.jackrabbit.rmi.server.ServerSession_Stub.save(Unknown
> Source)
> at
> org.apache.jackrabbit.rmi.client.ClientSession.save(ClientSession.java:207)
>
> nodes are referencable but not versionable - test involved adding 20 nodes
> in two sessions(10 nodes in one session) each in another thread at the same
> time to an empty repository, first we've created parent node ('a' in session
> one and 'b' in session two) and than we've putted there 10 nodes with
> different names (10 to node 'a' for session one and another 10 to node 'b'
> for session two) and it generates exception.
>
> BR,
> Marcin Nowak
>
>
> --
> Empowering business
> http://webinars.comarch.com
>