mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +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();
|
Context ctx = new Context();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
for (Iterator ci = ((Dispatcher) dispatcher).getConsumers()
|
for (Iterator ci = ((Dispatcher) dispatcher).getConsumers()
|
||||||
.iterator(); ci.hasNext();)
|
.iterator(); ci.hasNext();)
|
||||||
{
|
{
|
||||||
@@ -293,6 +295,13 @@ public class EventManager
|
|||||||
cp.getConsumer().finish(ctx);
|
cp.getConsumer().finish(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.complete();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
ctx.abort();
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -355,7 +355,7 @@ public class CollectionsResource extends Resource
|
|||||||
workspaceItem.update();
|
workspaceItem.update();
|
||||||
|
|
||||||
// Index item to browse.
|
// 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);
|
browse.indexItem(dspaceItem);
|
||||||
|
|
||||||
log.trace("Installing item to collection(id=" + collectionId + ").");
|
log.trace("Installing item to collection(id=" + collectionId + ").");
|
||||||
|
Reference in New Issue
Block a user