You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by "Pill, Juergen" <Ju...@softwareag.com> on 2001/09/12 15:49:29 UTC

RE: cvs commit: jakarta-slide/src/share/org/apache/slide/lock Loc kImpl.java

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: cmlenz@apache.org [mailto:cmlenz@apache.org]
Sent: Sunday, September 09, 2001 14.06 PM
To: jakarta-slide-cvs@apache.org
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:remm@apache.org">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);
       }