details:   https://code.openbravo.com/erp/devel/pi/rev/4e163d7f2a1d
changeset: 32313:4e163d7f2a1d
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Fri Jun 16 12:57:27 2017 +0200
summary:   fixed bug 36261: connections logged as abandoned in translate task

  Connection for Translate task was kept unclosed in SessionInfo so when the 
pool
  was destroyed it was logged as abandoned.

  Fixed by closing it before destroying pool.

diffstat:

 src-trl/src/org/openbravo/translate/Translate.java |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (30 lines):

diff -r b0884641a7bf -r 4e163d7f2a1d 
src-trl/src/org/openbravo/translate/Translate.java
--- a/src-trl/src/org/openbravo/translate/Translate.java        Fri Jun 16 
11:57:36 2017 +0200
+++ b/src-trl/src/org/openbravo/translate/Translate.java        Fri Jun 16 
12:57:27 2017 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2017 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -32,6 +32,7 @@
 import org.apache.log4j.PropertyConfigurator;
 import org.apache.xerces.parsers.SAXParser;
 import org.openbravo.database.CPStandAlone;
+import org.openbravo.database.SessionInfo;
 import org.openbravo.utils.DirFilter;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
@@ -726,6 +727,9 @@
    * The method to close database connection.
    */
   private void destroy() {
+    // remove cached connection from thread local
+    SessionInfo.init();
+
     pool.destroy();
   }
 }

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to