details:   https://code.openbravo.com/erp/devel/pi/rev/75b987d87e2d
changeset: 34012:75b987d87e2d
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Thu May 24 11:20:34 2018 +0200
summary:   fixes issue 38614: HeartbeatProcess can lead to database connection 
leaks

  The connection retrieved through OBDal was not being returned to the pool in 
the cases where the process can not complete its execution:

  - When the heartbeat is not active
  - When Internet is not available

diffstat:

 src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r b00ab8ef8b3a -r 75b987d87e2d 
src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java
--- a/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java      Wed May 
23 15:00:52 2018 +0000
+++ b/src/org/openbravo/erpCommon/ad_process/HeartbeatProcess.java      Thu May 
24 11:20:34 2018 +0200
@@ -111,12 +111,14 @@
     if (this.channel == Channel.SCHEDULED && !isHeartbeatActive()) {
       msg = Utility.messageBD(connection, "HB_INACTIVE", ctx.getLanguage());
       logger.logln(msg);
+      OBDal.getInstance().commitAndClose();
       return;
     }
 
     if (!HttpsUtils.isInternetAvailable()) {
       msg = Utility.messageBD(connection, "HB_INTERNET_UNAVAILABLE", 
ctx.getLanguage());
       logger.logln(msg);
+      OBDal.getInstance().commitAndClose();
       throw new Exception(msg);
     }
 

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