cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/acting DatabaseAuthenticatorAction.java
Date Sat, 25 Aug 2001 12:57:30 GMT
mman        01/08/25 05:57:30

  Modified:    src/org/apache/cocoon/acting
                        DatabaseAuthenticatorAction.java
  Log:
  Patch from Philipp Schmidt <philipp@codamax.com> 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;Martin.Man@seznam.cz&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:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message