You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by ChadDavis <ch...@gmail.com> on 2010/11/05 20:47:35 UTC

unexpected error on Node.isLocked()

I'm checking to see if nodes are locked.  The ones locked, and not
available to the current session via it's attached tokens, throw this
error:

javax.jcr.lock.LockException: Precondition Failed
	at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:109)
	at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
	at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:45)
	at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.getLockInfo(RepositoryServiceImpl.java:1372)
	at org.apache.jackrabbit.jcr2spi.WorkspaceManager.getLockInfo(WorkspaceManager.java:250)
	at org.apache.jackrabbit.jcr2spi.lock.LockManagerImpl.buildLockState(LockManagerImpl.java:321)
	at org.apache.jackrabbit.jcr2spi.lock.LockManagerImpl.getLockImpl(LockManagerImpl.java:392)
	at org.apache.jackrabbit.jcr2spi.lock.LockManagerImpl.isLocked(LockManagerImpl.java:165)
	at org.apache.jackrabbit.jcr2spi.NodeImpl.isLocked(NodeImpl.java:1259)

The API doesn't really suggest what would cause this.  I'm at a loss.

Re: unexpected error on Node.isLocked()

Posted by ChadDavis <ch...@gmail.com>.
On Fri, Nov 5, 2010 at 1:47 PM, ChadDavis <ch...@gmail.com> wrote:
> I'm checking to see if nodes are locked.  The ones locked, and not
> available to the current session via it's attached tokens, throw this
> error:
>
> javax.jcr.lock.LockException: Precondition Failed
>        at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:109)
>        at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:51)
>        at org.apache.jackrabbit.spi2dav.ExceptionConverter.generate(ExceptionConverter.java:45)
>        at org.apache.jackrabbit.spi2dav.RepositoryServiceImpl.getLockInfo(RepositoryServiceImpl.java:1372)
>        at org.apache.jackrabbit.jcr2spi.WorkspaceManager.getLockInfo(WorkspaceManager.java:250)
>        at org.apache.jackrabbit.jcr2spi.lock.LockManagerImpl.buildLockState(LockManagerImpl.java:321)
>        at org.apache.jackrabbit.jcr2spi.lock.LockManagerImpl.getLockImpl(LockManagerImpl.java:392)
>        at org.apache.jackrabbit.jcr2spi.lock.LockManagerImpl.isLocked(LockManagerImpl.java:165)
>        at org.apache.jackrabbit.jcr2spi.NodeImpl.isLocked(NodeImpl.java:1259)
>
> The API doesn't really suggest what would cause this.  I'm at a loss.
>

After some debugging, I find that this is bubbling up from the
httpclient api.  There's a recylce method on the http method classes
that is supposed to reset the http object for re-use.  I have no idea
why this works sometimes, and not others.  I suspect my unoptimized
code ( I've got far too many trips to the repo ) is revealing this.
I'm going to fix my code to not make so many trips.

Oddly enough, all of my trips to the repo during the processing of the
request don't cause a problem.  It's some trips to the repo triggered
by method calls in my presentation layer that cause the problem.