mman        01/08/25 05:57:30

  Modified:    src/org/apache/cocoon/acting
                        DatabaseAuthenticatorAction.java
  Log:
  Patch from Philipp Schmidt <[EMAIL PROTECTED]> for autocommit issues
  
  Revision  Changes    Path
  1.13      +12 -8     
xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAuthenticatorAction.java
  
  Index: DatabaseAuthenticatorAction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/org/apache/cocoon/acting/DatabaseAuthenticatorAction.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DatabaseAuthenticatorAction.java  2001/08/25 12:43:08     1.12
  +++ DatabaseAuthenticatorAction.java  2001/08/25 12:57:30     1.13
  @@ -1,4 +1,4 @@
  -// $Id: DatabaseAuthenticatorAction.java,v 1.12 2001/08/25 12:43:08 mman Exp $
  +// $Id: DatabaseAuthenticatorAction.java,v 1.13 2001/08/25 12:57:30 mman Exp $
   package org.apache.cocoon.acting;
   
   import org.apache.avalon.excalibur.datasource.DataSourceComponent;
  @@ -54,7 +54,7 @@
    * not verified.
    *
    * @author Martin Man &lt;[EMAIL PROTECTED]&gt;
  - * @version CVS $Revision: 1.12 $ $Date: 2001/08/25 12:43:08 $
  + * @version CVS $Revision: 1.13 $ $Date: 2001/08/25 12:57:30 $
    */
   public class DatabaseAuthenticatorAction extends AbstractDatabaseAction implements 
ThreadSafe
   {
  @@ -127,19 +127,23 @@
   
                   HashMap actionMap = this.propagateParameters (conf, rs,
                           session);
  -
  -                conn.commit();
  +                if(!conn.getAutoCommit()) {
  +                    conn.commit();
  +                }
                   return Collections.unmodifiableMap (actionMap);
               }
  -
  -            conn.rollback();
  +            if(!conn.getAutoCommit()) {
  +                conn.rollback();
  +            }
   
               req.setAttribute("message", "The username or password were incorrect, 
please check your CAPS LOCK key and try again.");
               getLogger ().debug ("DBAUTH: no results for query");
           } catch (Exception e) {
               if (conn != null) {
                   try {
  -                    conn.rollback();
  +                    if(!conn.getAutoCommit()) {
  +                        conn.rollback();
  +                    }
                   } catch (Exception se) {/* ignore */}
               }
               getLogger().debug ("exception: ", e);
  @@ -268,5 +272,5 @@
       }
   }
   
  -// $Id: DatabaseAuthenticatorAction.java,v 1.12 2001/08/25 12:43:08 mman Exp $
  +// $Id: DatabaseAuthenticatorAction.java,v 1.13 2001/08/25 12:57:30 mman Exp $
   // vim: set et ts=4 sw=4:
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to