details:   https://code.openbravo.com/erp/devel/pi/rev/3ed849d672ae
changeset: 34516:3ed849d672ae
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Mon Aug 20 09:17:57 2018 +0200
summary:   fixes bug 39128: compile.apply.module task gets stuck on 2.50 to pi 
updating

  The compile.apply.module ant task uses the Hibernate pool during the process 
of updating 2.50 to pi. Under this scenario, the task was never finishing 
because although all its actions were completed, the jvm was not able to 
terminate due to a non-daemon thread used by the Hibernate pool to validate its 
status.

  To avoid this problem, we force the stop of the non-daemon thread by 
explicitly closing the Hibernate pool once the task has finished using DAL.

diffstat:

 src/org/openbravo/erpCommon/modules/ApplyModuleTask.java |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (37 lines):

diff -r 446b08330250 -r 3ed849d672ae 
src/org/openbravo/erpCommon/modules/ApplyModuleTask.java
--- a/src/org/openbravo/erpCommon/modules/ApplyModuleTask.java  Tue Jul 31 
10:05:27 2018 -0500
+++ b/src/org/openbravo/erpCommon/modules/ApplyModuleTask.java  Mon Aug 20 
09:17:57 2018 +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) 2008-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2018 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -26,6 +26,7 @@
 import org.openbravo.base.AntExecutor;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.base.session.SessionFactoryController;
 import org.openbravo.dal.core.DalInitializingTask;
 import org.openbravo.database.CPStandAlone;
 
@@ -78,8 +79,14 @@
       log4j.error("Error checking modules with reference data", e);
     }
     if (ds != null && ds.length > 0) {
-      // Initialize DAL and execute
-      super.execute();
+      try {
+        // Initialize DAL and execute
+        super.execute();
+      } finally {
+        // Close the Hibernate pool to force the termination of a non-daemon 
thread used by the
+        // pool to validate its status. Otherwise this thread may cause this 
task to never finish.
+        SessionFactoryController.getInstance().closeHibernatePool();
+      }
     } else {
       try {
         if (!forceRefData) {

------------------------------------------------------------------------------
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