db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer RsIterator.java
Date Wed, 06 Oct 2004 23:09:59 GMT
arminw      2004/10/06 16:09:59

  Modified:    src/java/org/apache/ojb/broker/accesslayer RsIterator.java
  Log:
  merge with branch,
  bug fix by Gerhard Grosse
   <snip>
    Now the problem is that OJB's RsIterator silently swallows all
    exceptions thrown from ResultSet.next(). Thus the application receives
    a truncated query result and has no indication that something went
    awry.
   </snip>
  
  Revision  Changes    Path
  1.69      +10 -1     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.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- RsIterator.java	14 Sep 2004 16:03:33 -0000	1.68
  +++ RsIterator.java	6 Oct 2004 23:09:59 -0000	1.69
  @@ -31,6 +31,7 @@
   import org.apache.ojb.broker.PBStateEvent;
   import org.apache.ojb.broker.PBStateListener;
   import org.apache.ojb.broker.PersistenceBrokerException;
  +import org.apache.ojb.broker.PersistenceBrokerSQLException;
   import org.apache.ojb.broker.cache.LocalCache;
   import org.apache.ojb.broker.core.PersistenceBrokerImpl;
   import org.apache.ojb.broker.core.proxy.VirtualProxy;
  @@ -239,6 +240,14 @@
               if(ex instanceof ResourceClosedException)
               {
                   throw (ResourceClosedException)ex;
  +            }
  +            if(ex instanceof SQLException)
  +            {
  +                throw new PersistenceBrokerSQLException("Calling ResultSet.next() failed",
(SQLException) ex);
  +            }
  +            else
  +            {
  +               throw new PersistenceBrokerException("Can't get next row from ResultSet",
ex);
               }
           }
           if (logger.isDebugEnabled())
  
  
  

---------------------------------------------------------------------
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