db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcna...@apache.org
Subject cvs commit: db-torque/src/java/org/apache/torque/util BasePeer.java
Date Sat, 19 Jul 2003 21:10:16 GMT
jmcnally    2003/07/19 14:10:16

  Modified:    src/java/org/apache/torque/util Tag: TORQUE_3_0_BRANCH
                        BasePeer.java
  Log:
    replaced
  
    catch (TorqueException e)
    {
        Transaction.rollback(con);
        throw e;
    }
  
    with
  
    catch (TorqueException e)
    {
        if (con != null)  Transaction.rollback(con);
        throw e;
    }
  
    so that an exception which prevents getting a connection does not get
    obscured by the attempt to use the connection in rollback.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.55.2.3  +22 -7     db-torque/src/java/org/apache/torque/util/BasePeer.java
  
  Index: BasePeer.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/java/org/apache/torque/util/BasePeer.java,v
  retrieving revision 1.55.2.2
  retrieving revision 1.55.2.3
  diff -u -r1.55.2.2 -r1.55.2.3
  --- BasePeer.java	20 Jun 2003 08:40:02 -0000	1.55.2.2
  +++ BasePeer.java	19 Jul 2003 21:10:15 -0000	1.55.2.3
  @@ -425,8 +425,11 @@
           }
           catch (TorqueException e)
           {
  -            Transaction.rollback(con);
  -            throw new TorqueException(e);
  +            if (con != null) 
  +            {
  +                Transaction.rollback(con);
  +            }
  +            throw e;
           }
       }
   
  @@ -617,7 +620,10 @@
           }
           catch (TorqueException e)
           {
  -            Transaction.rollback(con);
  +            if (con != null) 
  +            {
  +                Transaction.rollback(con);
  +            }
               throw e;
           }
   
  @@ -1369,7 +1375,10 @@
           }
           catch (Exception e)
           {
  -            Transaction.rollback(con);
  +            if (con != null) 
  +            {
  +                Transaction.rollback(con);
  +            }
               throw new TorqueException(e);
           }
   
  @@ -1739,7 +1748,10 @@
           }
           catch (TorqueException e)
           {
  -            Transaction.rollback(con);
  +            if (con != null) 
  +            {
  +                Transaction.rollback(con);
  +            }
               throw e;
           }
       }
  @@ -1813,7 +1825,10 @@
           }
           catch (TorqueException e)
           {
  -            Transaction.rollback(db);
  +            if (db != null) 
  +            {
  +                Transaction.rollback(db);
  +            }
               throw e;
           }
       }
  
  
  

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


Mime
View raw message