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

Node.isLocked() within a transaction returns false for a locked node

XMLWordPrintable

    • Hide
          @Test  
          public void shouldLockNode() throws Exception {  
               Node node = session.getRootNode().addNode("test");  
               node.addMixin("mix:lockable");  
               session.save();  
            
               startTransaction();  
               JcrLockManager lockManager = session.getWorkspace().getLockManager();  
               Lock lock = lockManager.lock(node.getPath(), false, false, Long.MAX_VALUE, null);  
               assertTrue(node.isLocked());  
               commitTransaction();  
          }  
      
      Show
      @Test public void shouldLockNode() throws Exception { Node node = session.getRootNode().addNode( "test" ); node.addMixin( "mix:lockable" ); session.save(); startTransaction(); JcrLockManager lockManager = session.getWorkspace().getLockManager(); Lock lock = lockManager.lock(node.getPath(), false , false , Long .MAX_VALUE, null ); assertTrue(node.isLocked()); commitTransaction(); }

            hchiorean Horia Chiorean (Inactive)
            zcc39r Rustam Usmanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: