From b76bc50e930a313e90c016dc18218a3338ecd1c8 Mon Sep 17 00:00:00 2001 From: Artur Konczak Date: Mon, 13 Oct 2014 14:05:24 +0100 Subject: [PATCH] Fix to avoid connection pool exhaustion for slow downloads and big files --- .../java/org/dspace/app/webui/servlet/BitstreamServlet.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/BitstreamServlet.java b/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/BitstreamServlet.java index ea2e506c1d..09b19b1131 100644 --- a/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/BitstreamServlet.java +++ b/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/BitstreamServlet.java @@ -218,6 +218,9 @@ public class BitstreamServlet extends DSpaceServlet UIUtil.setBitstreamDisposition(bitstream.getName(), request, response); } + //DO NOT REMOVE IT - WE NEED TO FREE DB CONNECTION TO AVOID CONNECTION POOL EXHAUSTION FOR BIG FILES AND SLOW DOWNLOADS + context.complete(); + Utils.bufferedCopy(is, response.getOutputStream()); is.close(); response.getOutputStream().flush();