User: oleg    
  Date: 00/11/09 04:57:51

  Modified:    src/main/org/jboss/minerva/jdbc ConnectionInPool.java
  Log:
  Handling JDBC drivers that doesn't support getResultSetType() improved:
  before for such drivers (e.g. PostgreSQL) PreparedStatements returned
  to the pool in error state.
  
  Revision  Changes    Path
  1.5       +6 -5      jboss/src/main/org/jboss/minerva/jdbc/ConnectionInPool.java
  
  Index: ConnectionInPool.java
  ===================================================================
  RCS file: 
/products/cvs/ejboss/jboss/src/main/org/jboss/minerva/jdbc/ConnectionInPool.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConnectionInPool.java     2000/10/03 17:32:12     1.4
  +++ ConnectionInPool.java     2000/11/09 12:57:51     1.5
  @@ -29,7 +29,7 @@
    * outstanding statements are closed, and the connection is rolled back.  This
    * class is also used by statements, etc. to update the last used time for the
    * connection.
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    * @author Aaron Mulder ([EMAIL PROTECTED])
    */
   public class ConnectionInPool implements PooledObject, ConnectionWrapper {
  @@ -117,17 +117,18 @@
           if (st instanceof PreparedStatementInPool) {
               // Now return the "real" statement to the pool
               PreparedStatementInPool ps = (PreparedStatementInPool) st;
  +            PreparedStatement ups = ps.getUnderlyingPreparedStatement();
               int rsType = ResultSet.TYPE_FORWARD_ONLY;
               int rsConcur = ResultSet.CONCUR_READ_ONLY;
  +
               // We may have JDBC 1.0 driver
               try {
  -                rsType = ps.getResultSetType();
  -                rsConcur = ps.getResultSetConcurrency();
  +                rsType = ups.getResultSetType();
  +                rsConcur = ups.getResultSetConcurrency();
               } catch (Throwable th) {
               }
               PreparedStatementInPool.preparedStatementCache.put(
  -                    new PSCacheKey(con, ps.getSql(), rsType, rsConcur),
  -                    ps.getUnderlyingPreparedStatement());
  +                    new PSCacheKey(con, ps.getSql(), rsType, rsConcur), ups);
           }
       }
   
  
  
  

Reply via email to