Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034323
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2016-10-27 14:492016-12-16 18:38
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in Version3.0PR17Q1
StatusclosedFix in branchFixed in SCM revision9d78829840bc
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034323: TriggerHandler should remove from AD_SESSION_STATUS only the records added by the TriggerHandler itself

DescriptionThe TriggerHandler class controls the trigger disablement/enablement by adding and removing rows from the AD_SESSION_STATUS table.

Triggers are disabled by adding a record to AD_SESSION_STATUS with the isimporting column set to 'Y'. Triggers are reenabled by removing all the records from AD_SESSION_STATUS.

The problem comes when another handler want to use the AD_SESSION_STATUS table for their own purposes. For instance, the SymmetricDsTriggerHandler would like to control the trigger enablement by adding rows with a new custom column set to 'Y'. The way the TriggerHandler reenables the triggers, it will also affect to the other handler.
Steps To ReproduceIt is not easy to reproduce, as currently there are no other processes that use the AD_SESSION_STATUS table. But it is very easy to check that the TriggerHandler is not only removing the rows created by itself:

- Add manually an entry to AD_SESSION_STATUS:
INSERT INTO AD_SESSION_STATUS(ad_session_status_id, ad_client_id, ad_org_id, createdby, updatedby, isimporting) VALUES (get_uuid(), '0', '0', '0', '0', 'N')
- Execute TriggerHandler.disable()
- Execute TriggerHandler.enable()
- Check the AD_SESSION_STATUS contents in the database. The row created manually has been deleted.
Proposed SolutionIn TriggerHandler.enable(), replace

DELETE FROM AD_SESSION_STATUS

with

DELETE FROM AD_SESSION_STATUS WHERE isimporting = 'Y'
TagsNo tags attached.
Attached Files? file icon issue34323.export [^] (1,880 bytes) 2016-10-27 18:22

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0034224 closedmtaal Retail Modules Provide a Java API to disable SymmetricDS triggers 

-  Notes
(0091036)
hgbot (developer)
2016-11-01 17:30

Repository: erp/devel/pi
Changeset: 9d78829840bcc1d8abc67da71da78da0982b9ddc
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Oct 27 14:57:06 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9d78829840bcc1d8abc67da71da78da0982b9ddc [^]

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

---
M src/org/openbravo/dal/core/TriggerHandler.java
---
(0091038)
AugustoMauch (manager)
2016-11-01 17:54

The fix has passed try [1]

[1] http://ci.openbravo.com/view/try/job/try-init/5161/ [^]
(0091066)
hgbot (developer)
2016-11-02 15:10

Repository: erp/devel/pi
Changeset: 25ca6b41ced0cc66982bd2cdbaeeeff033657e7d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Nov 02 15:08:53 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/25ca6b41ced0cc66982bd2cdbaeeeff033657e7d [^]

Related with issue 34323: Supports adding columns to AD_SESSION_STATUS

The TriggerHandler.disable methods inserts a row in AD_SESSION_STATUS to soft-disable the triggers. The problem is that the insert statement did not include the list of columns names in the INSERT statement, resulting in the statemeng failing if any module adds a new column to the AD_SESSION_STATUS table.

---
M src/org/openbravo/dal/core/TriggerHandler.java
---
(0091157)
alostale (manager)
2016-11-04 08:08

code reviewed
(0092582)
hudsonbot (developer)
2016-12-16 18:38

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/dc8bf00badd0 [^]
Maturity status: Test
(0092584)
hudsonbot (developer)
2016-12-16 18:38

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/dc8bf00badd0 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-10-27 14:49 AugustoMauch New Issue
2016-10-27 14:49 AugustoMauch Assigned To => AugustoMauch
2016-10-27 14:49 AugustoMauch Modules => Core
2016-10-27 14:49 AugustoMauch Triggers an Emergency Pack => No
2016-10-27 14:52 AugustoMauch Review Assigned To => alostale
2016-10-27 18:09 AugustoMauch Relationship added related to 0034224
2016-10-27 18:22 AugustoMauch File Added: issue34323.export
2016-11-01 17:30 hgbot Checkin
2016-11-01 17:30 hgbot Note Added: 0091036
2016-11-01 17:30 hgbot Status new => resolved
2016-11-01 17:30 hgbot Resolution open => fixed
2016-11-01 17:30 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9d78829840bcc1d8abc67da71da78da0982b9ddc [^]
2016-11-01 17:54 AugustoMauch Note Added: 0091038
2016-11-02 15:10 hgbot Checkin
2016-11-02 15:10 hgbot Note Added: 0091066
2016-11-04 08:08 alostale Note Added: 0091157
2016-11-04 08:08 alostale Status resolved => closed
2016-11-04 08:08 alostale Fixed in Version => 3.0PR17Q1
2016-12-16 18:38 hudsonbot Checkin
2016-12-16 18:38 hudsonbot Note Added: 0092582
2016-12-16 18:38 hudsonbot Checkin
2016-12-16 18:38 hudsonbot Note Added: 0092584


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker