ozeigermann    2004/12/10 04:47:01

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        AbstractWebdavMethod.java
  Log:
  Included check for null locks into deadlock retry block
  
  Revision  Changes    Path
  1.67      +38 -34    
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
  
  Index: AbstractWebdavMethod.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- AbstractWebdavMethod.java 8 Dec 2004 01:33:52 -0000       1.66
  +++ AbstractWebdavMethod.java 10 Dec 2004 12:47:01 -0000      1.67
  @@ -41,6 +41,10 @@
   
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  +import javax.transaction.HeuristicMixedException;
  +import javax.transaction.HeuristicRollbackException;
  +import javax.transaction.NotSupportedException;
  +import javax.transaction.RollbackException;
   import javax.transaction.SystemException;
   import javax.transaction.Transaction;
   
  @@ -168,7 +172,7 @@
               new SimpleDateFormat("EEE MMMM d HH:mm:ss yyyy", Locale.US)
       };
   
  -    private static final int LOCK_LOG_LEVEL = Logger.DEBUG;
  +    private static final int LOCK_LOG_LEVEL = Logger.INFO;
       
       protected static final int READ_LOCK = 1;
       protected static final int WRITE_LOCK = 2;
  @@ -405,33 +409,6 @@
                   globalLockObtained = true;
               }
   
  -            /*
  -             * Check for object existence and cleanup locks but only if this 
is
  -             * not a request to finalize an external transaction. Otherwise 
we are
  -             * making calls to the store that require a transaction to be in 
process 
  -             * while we're trying to commit or abort the current transaction.
  -             */            
  -            if (!isEndofTransactionRequest()) {
  -                try {
  -                    // retrive to check it exists, otherwise it can't have 
locks
  -                    structure.retrieve(slideToken, requestUri);
  -                    // clear expired lock-tokens
  -                    UnlockListenerImpl listener = new 
UnlockListenerImpl(slideToken, token, config, req, resp);
  -                    lock.clearExpiredLocks(slideToken, requestUri, listener);
  -                    
  -                    if (listener.getUnlockCount() > 0) {
  -                        // If we have have cleared any lock or any lock-null 
resource in   
  -                        // the previous step we commit this changes, 
otherwise they will  
  -                        // be lost if executeRequest() exits with an 
exception (e.g. 
  -                        // because of Not Found 404)
  -                        token.commit();
  -                        token.begin();
  -                    }
  -                } catch (ObjectNotFoundException e) {
  -                    // ignore, it can't have locks
  -                }
  -            }
  -            
               boolean done = false;
               boolean retryUponConflict = isRepeatUponConflict() && 
!slideToken.isExternalTransaction();
               int retries = getMaxRetryRepeats();
  @@ -509,9 +486,36 @@
           }
       }
   
  -    protected void executeRedirect() throws AccessDeniedException, 
LinkedObjectNotFoundException,
  -            ObjectLockedException, RevisionDescriptorNotFoundException, 
ServiceAccessException,
  -            VetoException, WebdavException, IOException {
  +    protected void executeRedirect() throws IOException, SlideException, 
IllegalStateException,
  +            SecurityException, HeuristicMixedException, 
HeuristicRollbackException,
  +            RollbackException, NotSupportedException, SystemException {
  +        
  +        /*
  +         * Check for object existence and cleanup locks but only if this is
  +         * not a request to finalize an external transaction. Otherwise we 
are
  +         * making calls to the store that require a transaction to be in 
process 
  +         * while we're trying to commit or abort the current transaction.
  +         */            
  +        if (!isEndofTransactionRequest()) {
  +            try {
  +                // retrive to check it exists, otherwise it can't have locks
  +                structure.retrieve(slideToken, requestUri);
  +                // clear expired lock-tokens
  +                UnlockListenerImpl listener = new 
UnlockListenerImpl(slideToken, token, config, req, resp);
  +                lock.clearExpiredLocks(slideToken, requestUri, listener);
  +                
  +                if (listener.getUnlockCount() > 0) {
  +                    // If we have have cleared any lock or any lock-null 
resource in   
  +                    // the previous step we commit this changes, otherwise 
they will  
  +                    // be lost if executeRequest() exits with an exception 
(e.g. 
  +                    // because of Not Found 404)
  +                    token.commit();
  +                    token.begin();
  +                }
  +            } catch (ObjectNotFoundException e) {
  +                // ignore, it can't have locks
  +            }
  +        }
           
           boolean responseIsRedirected = false;
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to