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/METSStructureSet.java

    r8742 r9851  
    158158    select.setWhere(new GS3SQLWhere(whereItem));
    159159    connection.execute(select.toString());
     160    // clone the connection cos we are still usign the old result set
     161    GS3SQLConnection cloned_connection = connection.cloneConnection();
    160162
    161163    // start going through the matching metadata blocks
     
    164166        resultSet.first();
    165167        do {
    166         METSStructure structure = METSStructure.readSQL(document, connection, resultSet);
     168        METSStructure structure = METSStructure.readSQL(document, cloned_connection, resultSet);
    167169        if (structure != null) {
    168170            set.addStructure(structure);
    169171        }
    170172        } while (resultSet.next());
     173        cloned_connection.close();
     174        cloned_connection = null;
    171175    }
    172176    catch (SQLException sqlEx) {
    173177        System.out.println(sqlEx);
     178        sqlEx.printStackTrace();
    174179        System.exit(1);
    175180    }
Note: See TracChangeset for help on using the changeset viewer.