mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
3086: Commit after each item to increase performance
This commit is contained in:
@@ -77,9 +77,6 @@ public class OAIHarvester {
|
||||
protected PluginService pluginService;
|
||||
protected ConfigurationService configurationService;
|
||||
|
||||
// try to empty the cache on regular intervals
|
||||
public static final int CACHE_SIZE_LIMIT = 2000;
|
||||
|
||||
|
||||
// The collection this harvester instance is dealing with
|
||||
Collection targetCollection;
|
||||
@@ -368,11 +365,7 @@ public class OAIHarvester {
|
||||
processRecord(record, OREPrefix, currentRecord, totalListSize);
|
||||
ourContext.dispatchEvents();
|
||||
|
||||
// here we might need to clear the cache and update the total we have done so far
|
||||
if(ourContext.getCacheSize() >= CACHE_SIZE_LIMIT)
|
||||
{
|
||||
clearCache();
|
||||
}
|
||||
intermediateCommit();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,23 +438,6 @@ public class OAIHarvester {
|
||||
reloadRequiredEntities();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Reset the OAI cache, will commit our currently ingested items and create a new context.
|
||||
*/
|
||||
protected void clearCache()
|
||||
{
|
||||
try
|
||||
{
|
||||
ourContext.clearCache();
|
||||
reloadRequiredEntities();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
log.error(LogManager.getHeader(ourContext, "oai_harvest_cache_reset_error", "Error while attempting to reset the cache for the OAI harvest"), ex);
|
||||
}
|
||||
}
|
||||
|
||||
private void reloadRequiredEntities() throws SQLException {
|
||||
//Reload our objects in our cache
|
||||
targetCollection = ourContext.reloadEntity(targetCollection);
|
||||
|
Reference in New Issue
Block a user