You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Dominique Pfister (JIRA)" <ji...@apache.org> on 2005/11/30 17:50:30 UTC

[jira] Created: (JCR-284) Locking two same-name siblings and unlocking first apparently unlocks second instead.

Locking two same-name siblings and unlocking first apparently unlocks second instead.
-------------------------------------------------------------------------------------

         Key: JCR-284
         URL: http://issues.apache.org/jira/browse/JCR-284
     Project: Jackrabbit
        Type: Bug
  Components: locks  
    Versions: 1.1    
    Reporter: Dominique Pfister
 Assigned to: Dominique Pfister 


Executing the following test that unlocks the first of two locked same-name siblings:

public void testLocking() throws RepositoryException {
       Session jcrSession = ((S1SessionImpl) session).getSession();
       Node rootNode = jcrSession.getRootNode();

       Node n1 = rootNode.addNode("path");
       n1.addMixin("mix:lockable");
       Node n2 = rootNode.addNode("path");
       n2.addMixin("mix:lockable");

       jcrSession.save();

       n1.lock(true, true);
       n2.lock(true, true);

       System.out.println("n1.isLocked() = " + n1.isLocked());
       System.out.println("n2.isLocked() = " + n2.isLocked());
       assertTrue(n1.isLocked());
       assertTrue(n2.isLocked());

       n1.save();
       n1.unlock();

       System.out.println("n1.isLocked() = " + n1.isLocked());
       System.out.println("n2.isLocked() = " + n2.isLocked());
       assertFalse(n1.isLocked());
       assertTrue(n2.isLocked());
   }

Results in:

n1.isLocked() = true
n2.isLocked() = true
n1.isLocked() = true
n2.isLocked() = false

which is wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (JCR-284) Locking two same-name siblings and unlocking first apparently unlocks second instead.

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-284?page=all ]

Jukka Zitting updated JCR-284:
------------------------------

    Fix Version: 1.0
                     (was: 1.1)
        Version:     (was: 1.1)

> Locking two same-name siblings and unlocking first apparently unlocks second instead.
> -------------------------------------------------------------------------------------
>
>          Key: JCR-284
>          URL: http://issues.apache.org/jira/browse/JCR-284
>      Project: Jackrabbit
>         Type: Bug
>   Components: locks
>     Reporter: Dominique Pfister
>     Assignee: Dominique Pfister
>      Fix For: 1.0

>
> Executing the following test that unlocks the first of two locked same-name siblings:
> public void testLocking() throws RepositoryException {
>        Session jcrSession = ((S1SessionImpl) session).getSession();
>        Node rootNode = jcrSession.getRootNode();
>        Node n1 = rootNode.addNode("path");
>        n1.addMixin("mix:lockable");
>        Node n2 = rootNode.addNode("path");
>        n2.addMixin("mix:lockable");
>        jcrSession.save();
>        n1.lock(true, true);
>        n2.lock(true, true);
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertTrue(n1.isLocked());
>        assertTrue(n2.isLocked());
>        n1.save();
>        n1.unlock();
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertFalse(n1.isLocked());
>        assertTrue(n2.isLocked());
>    }
> Results in:
> n1.isLocked() = true
> n2.isLocked() = true
> n1.isLocked() = true
> n2.isLocked() = false
> which is wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (JCR-284) Locking two same-name siblings and unlocking first apparently unlocks second instead.

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-284?page=all ]
     
Dominique Pfister closed JCR-284:
---------------------------------


> Locking two same-name siblings and unlocking first apparently unlocks second instead.
> -------------------------------------------------------------------------------------
>
>          Key: JCR-284
>          URL: http://issues.apache.org/jira/browse/JCR-284
>      Project: Jackrabbit
>         Type: Bug
>   Components: locks
>     Versions: 1.1
>     Reporter: Dominique Pfister
>     Assignee: Dominique Pfister
>      Fix For: 1.1

>
> Executing the following test that unlocks the first of two locked same-name siblings:
> public void testLocking() throws RepositoryException {
>        Session jcrSession = ((S1SessionImpl) session).getSession();
>        Node rootNode = jcrSession.getRootNode();
>        Node n1 = rootNode.addNode("path");
>        n1.addMixin("mix:lockable");
>        Node n2 = rootNode.addNode("path");
>        n2.addMixin("mix:lockable");
>        jcrSession.save();
>        n1.lock(true, true);
>        n2.lock(true, true);
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertTrue(n1.isLocked());
>        assertTrue(n2.isLocked());
>        n1.save();
>        n1.unlock();
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertFalse(n1.isLocked());
>        assertTrue(n2.isLocked());
>    }
> Results in:
> n1.isLocked() = true
> n2.isLocked() = true
> n1.isLocked() = true
> n2.isLocked() = false
> which is wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (JCR-284) Locking two same-name siblings and unlocking first apparently unlocks second instead.

Posted by "Dominique Pfister (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-284?page=all ]
     
Dominique Pfister resolved JCR-284:
-----------------------------------

    Fix Version: 1.1
     Resolution: Fixed

LockManager internally removed the unlocked first sibling from its path map and shifted follower indices which is obviously wrong. Thanks to Roland Kofler for reporting this issue.

Fixed in revision 349986. 

> Locking two same-name siblings and unlocking first apparently unlocks second instead.
> -------------------------------------------------------------------------------------
>
>          Key: JCR-284
>          URL: http://issues.apache.org/jira/browse/JCR-284
>      Project: Jackrabbit
>         Type: Bug
>   Components: locks
>     Versions: 1.1
>     Reporter: Dominique Pfister
>     Assignee: Dominique Pfister
>      Fix For: 1.1

>
> Executing the following test that unlocks the first of two locked same-name siblings:
> public void testLocking() throws RepositoryException {
>        Session jcrSession = ((S1SessionImpl) session).getSession();
>        Node rootNode = jcrSession.getRootNode();
>        Node n1 = rootNode.addNode("path");
>        n1.addMixin("mix:lockable");
>        Node n2 = rootNode.addNode("path");
>        n2.addMixin("mix:lockable");
>        jcrSession.save();
>        n1.lock(true, true);
>        n2.lock(true, true);
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertTrue(n1.isLocked());
>        assertTrue(n2.isLocked());
>        n1.save();
>        n1.unlock();
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertFalse(n1.isLocked());
>        assertTrue(n2.isLocked());
>    }
> Results in:
> n1.isLocked() = true
> n2.isLocked() = true
> n1.isLocked() = true
> n2.isLocked() = false
> which is wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (JCR-284) Locking two same-name siblings and unlocking first apparently unlocks second instead.

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-284?page=all ]
     
Jukka Zitting reopened JCR-284:
-------------------------------


> Locking two same-name siblings and unlocking first apparently unlocks second instead.
> -------------------------------------------------------------------------------------
>
>          Key: JCR-284
>          URL: http://issues.apache.org/jira/browse/JCR-284
>      Project: Jackrabbit
>         Type: Bug
>   Components: locks
>     Reporter: Dominique Pfister
>     Assignee: Dominique Pfister
>      Fix For: 1.0

>
> Executing the following test that unlocks the first of two locked same-name siblings:
> public void testLocking() throws RepositoryException {
>        Session jcrSession = ((S1SessionImpl) session).getSession();
>        Node rootNode = jcrSession.getRootNode();
>        Node n1 = rootNode.addNode("path");
>        n1.addMixin("mix:lockable");
>        Node n2 = rootNode.addNode("path");
>        n2.addMixin("mix:lockable");
>        jcrSession.save();
>        n1.lock(true, true);
>        n2.lock(true, true);
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertTrue(n1.isLocked());
>        assertTrue(n2.isLocked());
>        n1.save();
>        n1.unlock();
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertFalse(n1.isLocked());
>        assertTrue(n2.isLocked());
>    }
> Results in:
> n1.isLocked() = true
> n2.isLocked() = true
> n1.isLocked() = true
> n2.isLocked() = false
> which is wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (JCR-284) Locking two same-name siblings and unlocking first apparently unlocks second instead.

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JCR-284?page=all ]
     
Jukka Zitting closed JCR-284:
-----------------------------

    Resolution: Fixed

Reclosing the issue after changing the fix version from 1.1 to 1.0.

> Locking two same-name siblings and unlocking first apparently unlocks second instead.
> -------------------------------------------------------------------------------------
>
>          Key: JCR-284
>          URL: http://issues.apache.org/jira/browse/JCR-284
>      Project: Jackrabbit
>         Type: Bug
>   Components: locks
>     Reporter: Dominique Pfister
>     Assignee: Dominique Pfister
>      Fix For: 1.0

>
> Executing the following test that unlocks the first of two locked same-name siblings:
> public void testLocking() throws RepositoryException {
>        Session jcrSession = ((S1SessionImpl) session).getSession();
>        Node rootNode = jcrSession.getRootNode();
>        Node n1 = rootNode.addNode("path");
>        n1.addMixin("mix:lockable");
>        Node n2 = rootNode.addNode("path");
>        n2.addMixin("mix:lockable");
>        jcrSession.save();
>        n1.lock(true, true);
>        n2.lock(true, true);
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertTrue(n1.isLocked());
>        assertTrue(n2.isLocked());
>        n1.save();
>        n1.unlock();
>        System.out.println("n1.isLocked() = " + n1.isLocked());
>        System.out.println("n2.isLocked() = " + n2.isLocked());
>        assertFalse(n1.isLocked());
>        assertTrue(n2.isLocked());
>    }
> Results in:
> n1.isLocked() = true
> n2.isLocked() = true
> n1.isLocked() = true
> n2.isLocked() = false
> which is wrong.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira