You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by loreii alpha <lo...@gmail.com> on 2009/04/20 13:31:40 UTC

remove property {http://www.jcp.org/jcr/1.0}lockOwner

Hi all,
this is my first post, thanks for your support.
I'm using jackrabbit in a high load environment so i need to lock the
directory before modify it, one typical operation is move nodes
(~1000) from the directory A into sub child directory A/a A/b A/c,
with few nodes (~300) i don't have problems but with more nodes is
raised a :

javax.jcr.RepositoryException: failed to remove property
{http://www.jcp.org/jcr/1.0}lockOwner of node /XX/lbs/C/B/B/B/B
        at org.apache.jackrabbit.core.NodeImpl.removeChildProperty(NodeImpl.java:574)
        at org.apache.jackrabbit.core.PropertyImpl.internalSetValue(PropertyImpl.java:282)
        at org.apache.jackrabbit.core.NodeImpl.internalSetProperty(NodeImpl.java:1319)
        at org.apache.jackrabbit.core.NodeImpl.unlock(NodeImpl.java:4523)

initially i supposed a missing lock refresh...
do you have some hint for me?


that's the snip of my code :

%<-----------------------------------------------------------------------------------------------------------------------
MyLockUtil{
public synchronized void locked(Node parent) throws
RepositoryException, InterruptedException{
		while(parent.isLocked()){
			wait(MAXIMUM_WAIT);
		}
		parent.lock(false,true);
	}

	public synchronized void unlock(Node parent) throws  RepositoryException{
		parent.unlock();
		notifyAll();	
	}
	
}

class snipp{
        mainOperation(){

			try{

MyLockUtil.getInstance().locked(current_directory);
                                  move(innerChild);
				current_directory.getSession().save();
				current_directory.getLock().refresh();
			
			}finally{
				              MyLockUtil.getInstance().unlocked(current_directory);
			}
          }

}

%<-----------------------------------------------------------------------------------------------------------------------

Thank you
lore