db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From olegn...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/util/batch BatchConnection.java
Date Tue, 03 Dec 2002 23:20:17 GMT
olegnitz    2002/12/03 15:20:17

  Modified:    src/java/org/apache/ojb/broker/util/batch
                        BatchConnection.java
  Log:
  If executeBatch() fails, it should be cleared, otherwise all subsequent executeBatch() calls
will fail.
  
  Revision  Changes    Path
  1.3       +12 -5     jakarta-ojb/src/java/org/apache/ojb/broker/util/batch/BatchConnection.java
  
  Index: BatchConnection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/util/batch/BatchConnection.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BatchConnection.java	3 Dec 2002 22:30:57 -0000	1.2
  +++ BatchConnection.java	3 Dec 2002 23:20:17 -0000	1.3
  @@ -183,13 +183,20 @@
       public void executeBatch() throws SQLException
       {
           BatchPreparedStatement batchStmt;
  -        for (Iterator it = _order.iterator(); it.hasNext(); )
  +        
  +        try
           {
  -            batchStmt = (BatchPreparedStatement) _statements.get(it.next());
  -            batchStmt.doExecute(_conn);
  +            for (Iterator it = _order.iterator(); it.hasNext(); )
  +            {
  +                batchStmt = (BatchPreparedStatement) _statements.get(it.next());
  +                batchStmt.doExecute(_conn);
  +            }
  +        }
  +        finally
  +        {
  +            _order.clear();
  +            _statements.clear();
           }
  -        _order.clear();
  -        _statements.clear();
       }
   
       public void commit() throws SQLException
  
  
  

Mime
View raw message