haul        2003/08/04 06:42:15

  Modified:    
src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp
                        AbstractEsqlQuery.java
  Log:
  Fix Bug 22050 inspired by gguillemot.at.rennes.jouve.fr (Gildas Guillemot)
  esql does not release database resources explicitly but rely on GC.
  
  Revision  Changes    Path
  1.5       +25 -1     
cocoon-2.1/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/AbstractEsqlQuery.java
  
  Index: AbstractEsqlQuery.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/databases/java/org/apache/cocoon/components/language/markup/xsp/AbstractEsqlQuery.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- AbstractEsqlQuery.java    3 Jul 2003 07:59:59 -0000       1.4
  +++ AbstractEsqlQuery.java    4 Aug 2003 13:42:15 -0000       1.5
  @@ -232,6 +232,30 @@
           }
       }
   
  +    /**
  +     * Clean up all database resources used by the query. In particular,
  +     * close result sets and statements. 
  +     *
  +     */
  +    public void cleanUp() {
  +        this.resultSetMetaData = null;
  +        if (this.resultSet != null){
  +            try {
  +                this.resultSet.close();
  +                this.resultSet = null;
  +            } catch (SQLException e) {
  +                // should never happen! (only cause: access error)
  +            }
  +        }
  +        if (this.preparedStatement != null){
  +            try {
  +                this.preparedStatement.close();
  +                this.preparedStatement = null;
  +            } catch (SQLException e) {
  +                // should never happen! (only cause: access error)
  +            }
  +        }
  +    }
   
       /* ************** FINAL methods *********************** */
   
  
  
  

Reply via email to