Changeset 9850


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

cloned the connection for processing each document

File:
1 edited

Legend:

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

    r8861 r9850  
    456456    ResultSet documents;
    457457    try {
    458       connection.execute(select.toString());
    459       documents = connection.getResultSet();
    460 
    461       if (documents.first())
    462       { do
    463     { DocumentInterface document = AbstractDocument.readSQL(connection, documents);
    464           list.addDocument(document);
    465     }
    466     while (documents.next());
    467       }
    468     }
    469     catch (java.sql.SQLException ex)
    470     { System.out.println(ex);
    471       return null;
     458    connection.execute(select.toString());
     459    documents = connection.getResultSet();
     460
     461     
     462    if (documents.first()) {
     463        // clone the connection cos we are still usign the old result set
     464        GS3SQLConnection cloned_connection = connection.cloneConnection();
     465       
     466        do {
     467        DocumentInterface document = AbstractDocument.readSQL(cloned_connection, documents);
     468        list.addDocument(document);
     469        }
     470        while (documents.next());
     471        cloned_connection.close();
     472        cloned_connection = null;
     473    }
     474    }
     475    catch (java.sql.SQLException ex) {
     476    System.out.println(ex);
     477    ex.printStackTrace();
     478    return null;
    472479    }
    473480
Note: See TracChangeset for help on using the changeset viewer.