Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-2718

Unable to deep-lock node for which existing session scoped lock has expired.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 5.4.1.Final
    • JCR
    • None

      This issue seems to be similar to MODE-2633.

      Steps to reproduce:

      1. Obtain a shallow session-scoped lock on a node and set timeout hint to 1 second.
      2. Wait a while to let the lock expire
      3. Try to acquire a deep lock on the same node

      The following exception is thrown:

      javax.jcr.lock.LockException: The node at location '/folder' cannot be locked because the descendant node '/folder' is already locked.
      	at org.modeshape.jcr.RepositoryLockManager.lock(RepositoryLockManager.java:349)
      	at org.modeshape.jcr.JcrLockManager.lock(JcrLockManager.java:273)
      	at org.modeshape.jcr.JcrLockManager.lock(JcrLockManager.java:237)
      	at org.foo.bar.LockTimeOutSessionScopedTest.checkNodeCanBeDeepLockedAfterTimeout(LockTimeOutSessionScopedTest.java:84)
      	at org.foo.bar.LockTimeOutSessionScopedTest.testSessionScopedLock(LockTimeOutSessionScopedTest.java:76)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
      	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      

      Interestingly enough, when trying to acquire a shallow lock instead of a deep one, it works.

      Please see the attached JUnit test to reproduce the behavior.

      This was tested with Modeshape 5.4.1.

            Unassigned Unassigned
            jkreutzfeld_jira Jan Kreutzfeld (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: