Ignore:
Timestamp:
2005-05-10T15:54:21+12:00 (19 years ago)
Author:
kjdon
Message:

some changes due to SQLConnection now closing the previous statement before executing a new one - this was a memory leak. but it means that if you want to iterate through an sql resultset and do other sql processing, you must use a different connection for the other sql requests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ant-install-branch/gsdl3/src/java/org/greenstone/gsdl3/gs3build/metadata/METSFileSet.java

    r8742 r9851  
    310310   
    311311    // start going through the matching file groups
     312    // clone the connection cos we are still usign the old result set
     313    GS3SQLConnection cloned_connection = connection.cloneConnection();
    312314    try {
    313315        ResultSet resultSet = connection.getResultSet();
    314316        resultSet.first();
    315317        do {
    316         METSFileGroup filegroup = METSFileGroup.readSQL(document, connection, resultSet);
     318        METSFileGroup filegroup = METSFileGroup.readSQL(document, cloned_connection, resultSet);
    317319        if (filegroup != null) {
    318320            set.addGroup(filegroup);
    319321        }
    320322        } while (resultSet.next());
     323
     324        cloned_connection.close();
     325        cloned_connection = null;
    321326    }
    322327    catch (SQLException sqlEx) {
    323328        System.out.println(sqlEx);
     329        sqlEx.printStackTrace();
    324330        System.exit(1);
    325331    }
Note: See TracChangeset for help on using the changeset viewer.