mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 07:23:08 +00:00
DS-2831 connections cleanup and context reuse
This commit is contained in:
@@ -284,6 +284,8 @@ public class EventManager
|
||||
{
|
||||
Context ctx = new Context();
|
||||
|
||||
try {
|
||||
|
||||
for (Iterator ci = ((Dispatcher) dispatcher).getConsumers()
|
||||
.iterator(); ci.hasNext();)
|
||||
{
|
||||
@@ -293,6 +295,13 @@ public class EventManager
|
||||
cp.getConsumer().finish(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
ctx.complete();
|
||||
|
||||
} catch (Exception e) {
|
||||
ctx.abort();
|
||||
throw e;
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
@@ -355,7 +355,7 @@ public class CollectionsResource extends Resource
|
||||
workspaceItem.update();
|
||||
|
||||
// Index item to browse.
|
||||
org.dspace.browse.IndexBrowse browse = new org.dspace.browse.IndexBrowse();
|
||||
org.dspace.browse.IndexBrowse browse = new org.dspace.browse.IndexBrowse(context);
|
||||
browse.indexItem(dspaceItem);
|
||||
|
||||
log.trace("Installing item to collection(id=" + collectionId + ").");
|
||||
|
Reference in New Issue
Block a user