# HG changeset patch
# User Asier Lostalé <asier.lostale@openbravo.com>
# Date 1523962196 -7200
#      Tue Apr 17 12:49:56 2018 +0200
# Node ID ec0926402d321001afc536ab9d883f1f10e4129e
# Parent  0c5cf3c6ecb0dcbd248a057ec9066533053f4c07
fixes 38389: DB connection unnecessarily retained while reading request content

  DB connection can be released while reading request content as it is not necessary
  and reading it is potentially slow.

diff -r 0c5cf3c6ecb0 -r ec0926402d32 src/org/openbravo/mobile/core/process/WebServiceAuthenticatedServlet.java
--- a/src/org/openbravo/mobile/core/process/WebServiceAuthenticatedServlet.java	Mon Mar 05 12:20:02 2018 +0530
+++ b/src/org/openbravo/mobile/core/process/WebServiceAuthenticatedServlet.java	Tue Apr 17 12:49:56 2018 +0200
@@ -139,6 +139,9 @@
   }
 
   protected String getRequestContent(HttpServletRequest request) throws IOException {
+    // DB conn is not needed to read contents, let's release it as it can take long to complete.
+    OBDal.getInstance().commitAndClose();
+
     Long initialTime = System.currentTimeMillis();
     Long timeout = null;
     Long timeToTimeout = null;
