mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +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();
|
||||
|
||||
Dispatcher dispatcher = pooledDispatcher.getObject();
|
||||
try {
|
||||
Dispatcher dispatcher = pooledDispatcher.getObject();
|
||||
|
||||
for (Iterator ci = dispatcher.getConsumers()
|
||||
.iterator(); ci.hasNext();)
|
||||
{
|
||||
ConsumerProfile cp = (ConsumerProfile) ci.next();
|
||||
if (cp != null)
|
||||
for (Iterator ci = dispatcher.getConsumers()
|
||||
.iterator(); ci.hasNext();)
|
||||
{
|
||||
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.");
|
||||
bitstreamService.delete(context, dspaceBitstream);
|
||||
|
||||
context.complete();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
|
@@ -518,6 +518,8 @@ public class CollectionsResource extends Resource
|
||||
|
||||
collectionService.delete(context, dspaceCollection);
|
||||
collectionService.update(context, dspaceCollection);
|
||||
|
||||
context.complete();
|
||||
}
|
||||
catch (ContextException e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user