db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henn...@apache.org
Subject cvs commit: jakarta-turbine-torque/src/java/org/apache/torque/util Transaction.java
Date Wed, 08 Jan 2003 11:11:30 GMT
henning     2003/01/08 03:11:29

  Modified:    src/java/org/apache/torque/util Transaction.java
  Log:
  Ah well. Of course we still shouldn't run into the connection handling
  stuff. :-)
  
  Revision  Changes    Path
  1.5       +20 -18    jakarta-turbine-torque/src/java/org/apache/torque/util/Transaction.java
  
  Index: Transaction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/util/Transaction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Transaction.java	8 Jan 2003 11:06:30 -0000	1.4
  +++ Transaction.java	8 Jan 2003 11:11:29 -0000	1.5
  @@ -181,26 +181,28 @@
                       + "DataSourceFactory. Check the logs and Torque.properties "
                       + "to better determine the cause.");
           }
  -
  -        try
  +        else
           {
  -            if (con.getMetaData().supportsTransactions()
  -                && con.getAutoCommit() == false)
  +            try
               {
  -                con.rollback();
  -                con.setAutoCommit(true);
  +                if (con.getMetaData().supportsTransactions()
  +                    && con.getAutoCommit() == false)
  +                {
  +                    con.rollback();
  +                    con.setAutoCommit(true);
  +                }
  +            }
  +            catch (SQLException e)
  +            {
  +                category.error("An attempt was made to rollback a transaction "
  +                               + "but the database did not allow the operation to be "
  +                               + "rolled back.", e);
  +                throw new TorqueException(e);
  +            }
  +            finally
  +            {
  +                Torque.closeConnection(con);
               }
  -        }
  -        catch (SQLException e)
  -        {
  -            category.error("An attempt was made to rollback a transaction "
  -                    + "but the database did not allow the operation to be "
  -                    + "rolled back.", e);
  -            throw new TorqueException(e);
  -        }
  -        finally
  -        {
  -            Torque.closeConnection(con);
           }
       }
   
  
  
  

Mime
View raw message