mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
DS-2831 connections cleanup, context reuse (master)
This commit is contained in:
@@ -292,16 +292,21 @@ public class EventServiceImpl implements EventService
|
|||||||
{
|
{
|
||||||
Context ctx = new Context();
|
Context ctx = new Context();
|
||||||
|
|
||||||
Dispatcher dispatcher = pooledDispatcher.getObject();
|
try {
|
||||||
|
Dispatcher dispatcher = pooledDispatcher.getObject();
|
||||||
|
|
||||||
for (Iterator ci = dispatcher.getConsumers()
|
for (Iterator ci = dispatcher.getConsumers()
|
||||||
.iterator(); ci.hasNext();)
|
.iterator(); ci.hasNext();)
|
||||||
{
|
|
||||||
ConsumerProfile cp = (ConsumerProfile) ci.next();
|
|
||||||
if (cp != null)
|
|
||||||
{
|
{
|
||||||
cp.getConsumer().finish(ctx);
|
ConsumerProfile cp = (ConsumerProfile) ci.next();
|
||||||
|
if (cp != null)
|
||||||
|
{
|
||||||
|
cp.getConsumer().finish(ctx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
ctx.abort();
|
||||||
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -628,6 +628,8 @@ public class BitstreamResource extends Resource
|
|||||||
|
|
||||||
log.trace("Deleting bitstream from all bundles.");
|
log.trace("Deleting bitstream from all bundles.");
|
||||||
bitstreamService.delete(context, dspaceBitstream);
|
bitstreamService.delete(context, dspaceBitstream);
|
||||||
|
|
||||||
|
context.complete();
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
{
|
{
|
||||||
|
@@ -518,6 +518,8 @@ public class CollectionsResource extends Resource
|
|||||||
|
|
||||||
collectionService.delete(context, dspaceCollection);
|
collectionService.delete(context, dspaceCollection);
|
||||||
collectionService.update(context, dspaceCollection);
|
collectionService.update(context, dspaceCollection);
|
||||||
|
|
||||||
|
context.complete();
|
||||||
}
|
}
|
||||||
catch (ContextException e)
|
catch (ContextException e)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user