details: https://code.openbravo.com/erp/devel/pi/rev/9d78829840bc changeset: 30566:9d78829840bc user: Augusto Mauch <augusto.mauch <at> openbravo.com> date: Thu Oct 27 14:57:06 2016 +0200 summary: Fixes issue 34323: TriggerHandler only removes the entries created by itself
The TriggerHandler class adds entries to AD_SESSION_STATUS with the isimporting column set to 'Y' to soft-disable the Openbravo triggers. Other processes may want to use the AD_SESSION_STATUS table to disable/reenable other features. The problem is that when TriggerHandler reenables the triggers, it removes all the contents of AD_SESSION_STATUS, not only the records created by the TriggerHandler itself. To fix this, now TriggerHandler only removes from AD_SESSION_STATUS the rows whose isimporting column is 'Y'. diffstat: src/org/openbravo/dal/core/TriggerHandler.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (21 lines): diff -r b06a2c5097c1 -r 9d78829840bc src/org/openbravo/dal/core/TriggerHandler.java --- a/src/org/openbravo/dal/core/TriggerHandler.java Mon Oct 31 09:41:22 2016 +0100 +++ b/src/org/openbravo/dal/core/TriggerHandler.java Thu Oct 27 14:57:06 2016 +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-2015 Openbravo SLU + * All portions are Copyright (C) 2008-2016 Openbravo SLU * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ @@ -104,7 +104,7 @@ Connection con = OBDal.getInstance().getConnection(); PreparedStatement ps = null; try { - ps = con.prepareStatement("DELETE FROM AD_SESSION_STATUS"); + ps = con.prepareStatement("DELETE FROM AD_SESSION_STATUS WHERE isimporting = 'Y'"); ps.executeUpdate(); } catch (Exception e) { throw new OBException("Couldn't disable triggers: ", e); ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits