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 oz...@apache.org on 2004/08/03 12:48:28 UTC

cvs commit: jakarta-slide/src/conf/webapp Domain.xml

ozeigermann    2004/08/03 03:48:28

  Modified:    src/webdav/server/org/apache/slide/webdav/method
                        AbstractWebdavMethod.java
               src/conf/webapp Domain.xml
  Log:
  Added switch (on by default) that allows all methods to be executed
  inside transactions
  
  Revision  Changes    Path
  1.42      +19 -0     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.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- AbstractWebdavMethod.java	3 Aug 2004 09:37:47 -0000	1.41
  +++ AbstractWebdavMethod.java	3 Aug 2004 10:48:27 -0000	1.42
  @@ -340,6 +340,10 @@
               if (!slideToken.isExternalTransaction()) {
                   token.begin();
                   transactionIsStarted = true;
  +                if (txForAllRequests()) {
  +                    slideToken.setForceStoreEnlistment(true);
  +                }
  +
                   if (this instanceof ReadMethod) {
                       assureGlobalReadLock();
                   } else if (this instanceof WriteMethod) {
  @@ -801,11 +805,26 @@
           return "true".equalsIgnoreCase(token.getNamespaceConfig().getParameter("history-collection-hack"));
       }
   
  +    /**
  +     * Checks whether all requests shall be done inside of transactions.
  +     */
  +    protected boolean txForAllRequests() {
  +        return "true".equalsIgnoreCase(token.getNamespaceConfig().getParameter("all-methods-in-transactions"));
  +    }
  +
  +    /**
  +     * Checks if Slide is configured to allow at most a single write request at a time.
  +     * @return <code>true</code> if there can be at most one write request at a time 
  +     */
       protected boolean isSequentialWrite() {
           String sm = token.getNamespaceConfig().getParameter("sequential-mode");
           return ("write".equalsIgnoreCase(sm) || "full".equalsIgnoreCase(sm));
       }
       
  +    /**
  +     * Checks if Slide is configured to allow reads while write requests are being executed.
  +     * @return <code>true</code> if reads are disallowed during writes 
  +     */
       protected boolean isSequentialRead() {
           return "full".equalsIgnoreCase(token.getNamespaceConfig().getParameter("sequential-mode"));
       }
  
  
  
  1.64      +2 -0      jakarta-slide/src/conf/webapp/Domain.xml
  
  Index: Domain.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/conf/webapp/Domain.xml,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- Domain.xml	27 Jul 2004 11:39:49 -0000	1.63
  +++ Domain.xml	3 Aug 2004 10:48:27 -0000	1.64
  @@ -75,6 +75,8 @@
               <parameter name="nested_roles_maxdepth">0</parameter>
               <!-- Can be "off", "write" and "full" -->
               <parameter name="sequential-mode">full</parameter>
  +            <!-- "false" lets all read-only methods be executed outside of transactions -->
  +            <parameter name="all-methods-in-transactions">true</parameter>
           </configuration>
           <data>
               <objectnode classname="org.apache.slide.structure.SubjectNode" uri="/">
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org