mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 22:43:12 +00:00
DS-2831 connections cleanup and context reuse
This commit is contained in:
@@ -284,14 +284,23 @@ public class EventManager
|
||||
{
|
||||
Context ctx = new Context();
|
||||
|
||||
for (Iterator ci = ((Dispatcher) dispatcher).getConsumers()
|
||||
.iterator(); ci.hasNext();)
|
||||
{
|
||||
ConsumerProfile cp = (ConsumerProfile) ci.next();
|
||||
if (cp != null)
|
||||
try {
|
||||
|
||||
for (Iterator ci = ((Dispatcher) dispatcher).getConsumers()
|
||||
.iterator(); ci.hasNext();)
|
||||
{
|
||||
cp.getConsumer().finish(ctx);
|
||||
ConsumerProfile cp = (ConsumerProfile) ci.next();
|
||||
if (cp != null)
|
||||
{
|
||||
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