ozeigermann    2004/07/05 00:49:19

  Modified:    src/webdav/server/org/apache/slide/webdav WebdavServlet.java
  Log:
  Added HACK to only check for collection when not inside
  external transaction.
  This is necessary as this check is done outside of any transaction and
  thus possibly outside of an external transaction this get/post
  request is part of. This has lead to problems when the external
  transaction already has blocking write locks on the resource and
  thus blocks itself. This will happen with high isolation of physical
  store and a put xxx, get xxx sequence.
  
  Revision  Changes    Path
  1.60      +12 -6     
jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java
  
  Index: WebdavServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/WebdavServlet.java,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- WebdavServlet.java        24 Jun 2004 13:18:53 -0000      1.59
  +++ WebdavServlet.java        5 Jul 2004 07:49:19 -0000       1.60
  @@ -48,6 +48,7 @@
   import org.apache.slide.structure.ObjectNotFoundException;
   import org.apache.slide.util.logger.Logger;
   import org.apache.slide.webdav.util.DirectoryIndexGenerator;
  +import org.apache.slide.webdav.util.WebdavConstants;
   import org.apache.slide.webdav.util.WebdavUtils;
   import org.apache.util.DOMUtils;
   import org.apache.util.WebdavStatus;
  @@ -150,8 +151,8 @@
               resp.setStatus(WebdavStatus.SC_OK);
               
               String methodName = req.getMethod();
  -            if ((methodName.equalsIgnoreCase("GET") ||
  -                     methodName.equalsIgnoreCase("POST")) &&
  +            if (!isExtTx(req) && 
  +                (methodName.equalsIgnoreCase("GET") || 
methodName.equalsIgnoreCase("POST")) &&
                   isCollection(req)) {
                   // let the standard doGet() / doPost() methods handle
                   // GET/POST requests on collections (to display a directory
  @@ -179,6 +180,11 @@
                   token.getLogger().log("<== "+req.getMethod()+" end: 
"+sdf.format(new Date(System.currentTimeMillis()))+" 
["+Thread.currentThread().getName()+"]", LOG_CHANNEL, Logger.DEBUG);
           }
           
  +    }
  +    
  +    private boolean isExtTx(HttpServletRequest req) {
  +        String hTxIdStr = req.getHeader(WebdavConstants.H_TRANSACTION);
  +        return (hTxIdStr != null);
       }
       
       private boolean isCollection(HttpServletRequest req) {
  
  
  

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

Reply via email to