why?

I believe we have now following problem:


        private void deleteObject(SlideToken token, String targetUri,
                                                          MacroException e)
{
                
                Domain.debug("Delete object : " + targetUri);
                
                try {
                        
                        ObjectNode currentObject =
                                structureHelper.retrieve(token, targetUri,
false);
                        
                        // Removing children objects
                        if (currentObject.hasChildren()) {
                                Enumeration children =
currentObject.enumerateChildren();
                                while (children.hasMoreElements()) {
                                        deleteObject(token, (String)
children.nextElement(), e);
                                }
                        }
                        
                        // Removing all revisions
                        NodeRevisionDescriptors revisionDescriptors =
                                contentHelper.retrieve(token,
currentObject.getUri());
                        
                        // if the object is not revisioned remove it
completely
                        // from it's associated stores
                        if (!revisionDescriptors.isVersioned()) {
                                // remove the associated locks
                                Enumeration locks =
lockHelper.enumerateLocks
                                        (token, currentObject.getUri());
                                while (locks.hasMoreElements()) {
                                        lockHelper.unlock(token, (NodeLock)
locks.nextElement());
                                }


The delete method will now unlock the current URI, plus the father URI, etc.
This pattern occurs in multiple places:

LockMethod:
                case LOCK_REFRESH:
                        
                        try {
                                
                                Enumeration lockTokens =
                                        lock.enumerateLocks(slideToken,
lockInfo_lockSubject);
                                
                                NodeLock currentLockToken = null;
                                Date newExpirationDate =
                                        new Date((new Date()).getTime() +
(lockDuration * 1000));
                                while (lockTokens.hasMoreElements()) {
                                        currentLockToken = (NodeLock)
lockTokens.nextElement();
                                        lock.renew(slideToken,
currentLockToken,
        
newExpirationDate);
                                }




Does this sound reasonable?

juergen







-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 09, 2001 14.06 PM
To: [EMAIL PROTECTED]
Subject: cvs commit: jakarta-slide/src/share/org/apache/slide/lock
LockImpl.java


cmlenz      01/09/09 05:05:57

  Modified:    src/share/org/apache/slide/lock LockImpl.java
  Log:
  - enumerateLocks() without the 'inherited' parameter should pass 'true' as
    parameter value when calling enumerateLocks() with the 'inherited'
    parameter
  
  Revision  Changes    Path
  1.19      +5 -5
jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java
  
  Index: LockImpl.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- LockImpl.java     2001/09/08 19:50:37     1.18
  +++ LockImpl.java     2001/09/09 12:05:57     1.19
  @@ -1,7 +1,7 @@
   /*
  - * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v 1.18
2001/09/08 19:50:37 cmlenz Exp $
  - * $Revision: 1.18 $
  - * $Date: 2001/09/08 19:50:37 $
  + * $Header:
/home/cvs/jakarta-slide/src/share/org/apache/slide/lock/LockImpl.java,v 1.19
2001/09/09 12:05:57 cmlenz Exp $
  + * $Revision: 1.19 $
  + * $Date: 2001/09/09 12:05:57 $
    *
    * ====================================================================
    *
  @@ -78,7 +78,7 @@
    * Lock helper class.
    * 
    * @author <a href="mailto:[EMAIL PROTECTED]";>Remy Maucherat</a>
  - * @version $Revision: 1.18 $
  + * @version $Revision: 1.19 $
    */
   public final class LockImpl implements Lock {
       
  @@ -310,7 +310,7 @@
           throws ServiceAccessException, ObjectNotFoundException, 
           LockTokenNotFoundException {
           
  -        return enumerateLocks(slideToken, objectUri, false);
  +        return enumerateLocks(slideToken, objectUri, true);
       }
       
       
  
  
  

Reply via email to