db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer RsIterator.java
Date Fri, 27 Feb 2004 17:24:25 GMT
brianm      2004/02/27 09:24:25

  Modified:    src/java/org/apache/ojb/broker/accesslayer RsIterator.java
  Log:
  Minor cleanup on exception handling
  
  Revision  Changes    Path
  1.59      +10 -13    db-ojb/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java
  
  Index: RsIterator.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/RsIterator.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- RsIterator.java	10 Feb 2004 15:18:53 -0000	1.58
  +++ RsIterator.java	27 Feb 2004 17:24:25 -0000	1.59
  @@ -297,7 +297,6 @@
                   // set target object
                   getAfterLookupEvent().setTarget(obj);
                   getBroker().fireBrokerEvent(getAfterLookupEvent());
  -
                   return obj;
               }
               else
  @@ -305,19 +304,17 @@
                   throw new NoSuchElementException("inner hasNext was false");
               }
           }
  -        catch (Exception ex)
  +        catch (ResourceClosedException ex)
           {
               autoReleaseDbResources();
  -            // ex.printStackTrace();
  -            if(ex instanceof ResourceClosedException)
  -            {
  -                throw (ResourceClosedException) ex;
  -            }
  -            else
  -            {
  -                logger.error("Error while iterate ResultSet for query " + m_queryObject,
ex);
  -                throw new NoSuchElementException("Could not obtain next object: " + ex.getMessage());
  -            }
  +            throw ex;
  +        }
  +        catch (NoSuchElementException ex)
  +        {
  +            autoReleaseDbResources();
  +            logger.error("Error while iterate ResultSet for query " + m_queryObject, ex);
  +            throw new NoSuchElementException("Could not obtain next object: " + ex.getMessage());
  +
           }
       }
   
  
  
  

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


Mime
View raw message