Write imported hashes to the database in sets

This commit is contained in:
Ann Priestman 2017-08-17 08:33:36 -04:00
parent b6ebe15da0
commit f11b2aa334

View File

@ -72,6 +72,7 @@ final class ImportHashDatabaseDialog extends javax.swing.JDialog {
private final JFileChooser fileChooser = new JFileChooser();
private final static String LAST_FILE_PATH_KEY = "CentralRepositoryImport_Path"; // NON-NLS
private final int HASH_IMPORT_THRESHOLD = 5000;
private EamOrganization selectedOrg = null;
private List<EamOrganization> orgs = null;
private final Collection<JTextField> textBoxes;
@ -646,6 +647,11 @@ final class ImportHashDatabaseDialog extends javax.swing.JDialog {
"");
globalInstances.add(eamGlobalFileInstance);
if(numLines % HASH_IMPORT_THRESHOLD == 0){
dbManager.bulkInsertReferenceTypeEntries(globalInstances, contentType);
globalInstances.clear();
}
}
dbManager.bulkInsertReferenceTypeEntries(globalInstances, contentType);