Hi,
While trying to create a node under /var/<app> folder in CQ and saving it using javax.jcr.Session.save() , system is throwing the below exception.
javax.jcr.InvalidItemStateException: Item seems to have been removed externally at org.apache.jackrabbit.core.state.SessionItemStateManager.getDescendantTransientItemStates(SessionItemStateManager.java:363)
at org.apache.jackrabbit.core.ItemSaveOperation.getTransientStates(ItemSaveOperation.java:313)
at org.apache.jackrabbit.core.ItemSaveOperation.perform(ItemSaveOperation.java:98)
at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
at org.apache.jackrabbit.core.session.SessionSaveOperation.perform(SessionSaveOperation.java:65)
at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
at com.day.crx.core.CRXSessionImpl.save(CRXSessionImpl.java:142)
If i understood correctly , this error could be due to some other session(probably a session created in one of the author instance in the CQ cluster) has been removing it but did not persist the removal in its session properly and holding the lock and restricting other sessions to create any new nodes under this folder /var/<app> folder.
This has not been happening when there are concurrent requests. Even at the time of one thread executing the action, system is not allowing any of the node to be created under that var/<app> folder via our app code which is using JCR API session.save method to create and save nodes under that particular folder.
Can someone please help in finding a way to resolve this exception? If my understanding is correct , is there a way to clear the lock? if we restart CQ server, will the lock be cleared?
Thanks.
Solved! Go to Solution.
Views
Replies
Total Likes
Basically your problem is, that a session.save() happens in that tree, while your session is open; and when it wants to save nodes, JCR refuses to do so, because somehting has changed in the meanwhile. Some approaches to tackle it:
Jörg
Views
Replies
Total Likes
What version of AEM are you running?
Where is the code creating the node running - in a OSGI service? Is it triggered on a schedule or by user action?
Could you post a sample of the code?
Views
Replies
Total Likes
Basically your problem is, that a session.save() happens in that tree, while your session is open; and when it wants to save nodes, JCR refuses to do so, because somehting has changed in the meanwhile. Some approaches to tackle it:
Jörg
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies