Fix to avoid connection pool exhaustion for slow downloads and big files

This commit is contained in:
Artur Konczak
2014-10-13 14:05:24 +01:00
parent 93c024bf89
commit b76bc50e93

View File

@@ -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();