DS-2831 connections cleanup, context reuse (master)

This commit is contained in:
Arnaud de Bossoreille
2015-10-29 13:51:06 +01:00
parent 868120dda4
commit cb34855f20
3 changed files with 16 additions and 7 deletions

View File

@@ -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;
}
}

View File

@@ -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)
{

View File

@@ -518,6 +518,8 @@ public class CollectionsResource extends Resource
collectionService.delete(context, dspaceCollection);
collectionService.update(context, dspaceCollection);
context.complete();
}
catch (ContextException e)
{