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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034224
TypeCategorySeverityReproducibilityDate SubmittedLast Update
feature request[Retail Modules] StoreServermajorhave not tried2016-10-17 18:282016-12-02 10:48
ReporterAugustoMauchView Statuspublic 
Assigned Tomtaal 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisiona5d8683a1304
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomtaal
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0034224: Provide a Java API to disable SymmetricDS triggers

DescriptionSome processes need to import data in an instance running SymmetricDS but the rows being import don't need to be captured by the SymmetricDS triggers and synchronized.

This happens for instance when a process to load the historical data of a store sersver yet to be created is imported in the central server. All those records should not be sent to any server, so it makes sense to disable the triggers so that those records are not captured and router.
Steps To Reproduce-
TagsNo tags attached.
Attached Files? file icon issue34224.export [^] (14,811 bytes) 2016-10-27 18:22

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0034323 closedAugustoMauch Openbravo ERP TriggerHandler should remove from AD_SESSION_STATUS only the records added by the TriggerHandler itself 

-  Notes
(0090727)
AugustoMauch (manager)
2016-10-20 16:24
edited on: 2016-10-20 16:24

Documentation for the upcoming feature is available here http://wiki.openbravo.com/wiki/How_to_Disable_the_SymmetricDS_Triggers [^]

(0091037)
hgbot (developer)
2016-11-01 17:49

Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: b0ccadb4f6f0e1b646b4bd2f1f642254f9317fc5
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Oct 27 18:18:37 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/b0ccadb4f6f0e1b646b4bd2f1f642254f9317fc5 [^]

Fixes issue 34224: SymmetricDS triggers can be disabled programatically

The class SymmetricDSTriggerHandler enables/reenables the SymmetricDS in a similar way the TriggerHandler class does the same with the standard Openbravo triggers.

A column called EM_Strsync_Symds_Trg_Disabled has been added to ad_session_status, the SymmetricDSTriggerHandler trigger adds a record with that column set to 'TRUE' to soft disable the triggers. The SymmetricDS triggers are now appended by a check that calls the function STRSYNC_ISTRIGGERENABLED, it will soft disable the trigger if it returns true.

This fix depends on the fix of this issue [1] to be compatible with the TriggerHandler. Without this change, calling TriggerHandler.enable will result in the SymmetricDS triggers being enabled to.

In the future the SymmetricDSTriggerHandler might be updated to use a temporary table instead of ad_session_status. This way it can be ensured that the insertions done to the table are not accidentally commited in the database.

[1] https://issues.openbravo.com/view.php?id=34323 [^]

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src/org/openbravo/replication/symmetricds/SymmetricDSConfiguration_data.xsql
M src/org/openbravo/replication/symmetricds/SymmetricDsTablePopulator.java
A src-db/database/model/functions/STRSYNC_ISTRIGGERENABLED.xml
A src-db/database/model/modifiedTables/AD_SESSION_STATUS.xml
A src/org/openbravo/replication/symmetricds/util/SymmetricDSTriggerHandler.java
---
(0091056)
hgbot (developer)
2016-11-02 11:32

Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: d896cdad51773c2c0cbedca6c63ca3cb135fb69d
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Nov 02 11:31:53 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/d896cdad51773c2c0cbedca6c63ca3cb135fb69d [^]

Related with issue 34224: Fixes dbconsistency problem

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
---
(0091071)
hgbot (developer)
2016-11-03 10:18

Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 02e8f0139c3417db268862d25d78a5d3004190d0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Nov 03 10:18:20 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/02e8f0139c3417db268862d25d78a5d3004190d0 [^]

Related with issue 34224: Fixes function so that it compiles in Oracle

---
M src-db/database/model/functions/STRSYNC_ISTRIGGERENABLED.xml
---
(0091678)
hgbot (developer)
2016-11-20 22:44

Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 2097ebfd6bdbc76ee467ba1e9e6cf3d12f97c8c8
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Nov 20 22:44:39 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/2097ebfd6bdbc76ee467ba1e9e6cf3d12f97c8c8 [^]

Related to issue 34224: Provide a Java API to disable SymmetricDS triggers
Added testcase

---
A src/org/openbravo/replication/symmetricds/util/TestTriggerEnabling.java
---
(0091680)
hgbot (developer)
2016-11-20 22:48

Repository: tools/automation/pi-mobile
Changeset: 82cbe46ab79199a1ef3e74000bd7296a042a8e2d
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Nov 20 22:47:53 2016 +0100
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/82cbe46ab79199a1ef3e74000bd7296a042a8e2d [^]

Related to issue 34224: Provide a Java API to disable SymmetricDS triggers
Add trigger disabling testcase

---
M src-test/org/openbravo/test/mobile/retail/multiserver/unittests/suites/dbsynch/DatabaseSynchronizationSuite.java
A src-test/org/openbravo/test/mobile/retail/multiserver/unittests/tests/dbsynch/TestTriggerDisabling.java
---
(0091681)
hgbot (developer)
2016-11-20 22:51

Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 799a8baf0f4848f10162ef2f997c07890bfc453e
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Nov 20 22:51:13 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/799a8baf0f4848f10162ef2f997c07890bfc453e [^]

Related to issue 34224: Provide a Java API to disable SymmetricDS triggers
Prevent that disabling of trigger leaks to other tests by putting in the finally block

---
M src/org/openbravo/replication/symmetricds/util/TestTriggerEnabling.java
---
(0091682)
mtaal (manager)
2016-11-21 06:30
edited on: 2016-11-21 06:31

Code reviewed, testcase added which passes. Remaining is to review the testcase.

https://ci.openbravo.com/view/storeserver/job/ret-ms-store1-pgsql/442/testReport/org.openbravo.test.mobile.retail.multiserver.unittests.tests.dbsynch/TestTriggerDisabling/ [^]

(0091813)
AugustoMauch (manager)
2016-11-25 09:40

Two small comments:
- Lines 46-64 are enclosed in a block needlessly
- In this line [1] the connection is commited, but it should be rolled back

[1] https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/799a8baf0f48/src/org/openbravo/replication/symmetricds/util/TestTriggerEnabling.java#l63 [^]
(0091836)
hgbot (developer)
2016-11-25 12:38

Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: a5d8683a130409a165351d916a43b7308711e776
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Fri Nov 25 12:37:52 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/a5d8683a130409a165351d916a43b7308711e776 [^]

Fixes issue 34224: Provide a Java API to disable SymmetricDS triggers
Kept the try block as this gives better scoping of local vars, moved the name var inside the block
Moved the commit to the finally block and changed to a rollback
Changed the exception text to make it clear what number is location of the exception and what number is the count

---
M src/org/openbravo/replication/symmetricds/util/TestTriggerEnabling.java
---
(0092016)
AugustoMauch (manager)
2016-12-02 10:48

Code reviewed

- Issue History
Date Modified Username Field Change
2016-10-17 18:28 AugustoMauch New Issue
2016-10-17 18:28 AugustoMauch Assigned To => AugustoMauch
2016-10-17 18:28 AugustoMauch Triggers an Emergency Pack => No
2016-10-20 16:24 AugustoMauch Note Added: 0090727
2016-10-20 16:24 AugustoMauch Note Edited: 0090727 View Revisions
2016-10-20 16:27 AugustoMauch File Added: disableSymmetricDsTriggers.export
2016-10-20 16:28 AugustoMauch Status new => scheduled
2016-10-20 16:33 AugustoMauch Note Added: 0090730
2016-10-27 18:09 AugustoMauch Relationship added related to 0034323
2016-10-27 18:22 AugustoMauch File Deleted: disableSymmetricDsTriggers.export
2016-10-27 18:22 AugustoMauch File Added: issue34224.export
2016-11-01 17:34 AugustoMauch Review Assigned To => mtaal
2016-11-01 17:34 AugustoMauch Note Deleted: 0090730
2016-11-01 17:49 hgbot Checkin
2016-11-01 17:49 hgbot Note Added: 0091037
2016-11-01 17:49 hgbot Status scheduled => resolved
2016-11-01 17:49 hgbot Resolution open => fixed
2016-11-01 17:49 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/b0ccadb4f6f0e1b646b4bd2f1f642254f9317fc5 [^]
2016-11-02 11:32 hgbot Checkin
2016-11-02 11:32 hgbot Note Added: 0091056
2016-11-03 10:18 hgbot Checkin
2016-11-03 10:18 hgbot Note Added: 0091071
2016-11-20 22:44 hgbot Checkin
2016-11-20 22:44 hgbot Note Added: 0091678
2016-11-20 22:48 hgbot Checkin
2016-11-20 22:48 hgbot Note Added: 0091680
2016-11-20 22:51 hgbot Checkin
2016-11-20 22:51 hgbot Note Added: 0091681
2016-11-21 06:30 mtaal Note Added: 0091682
2016-11-21 06:31 mtaal Note Edited: 0091682 View Revisions
2016-11-25 09:40 AugustoMauch Note Added: 0091813
2016-11-25 12:24 mtaal Status resolved => new
2016-11-25 12:24 mtaal Resolution fixed => open
2016-11-25 12:24 mtaal Assigned To AugustoMauch => mtaal
2016-11-25 12:38 hgbot Checkin
2016-11-25 12:38 hgbot Note Added: 0091836
2016-11-25 12:38 hgbot Status new => resolved
2016-11-25 12:38 hgbot Resolution open => fixed
2016-11-25 12:38 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/b0ccadb4f6f0e1b646b4bd2f1f642254f9317fc5 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/a5d8683a130409a165351d916a43b7308711e776 [^]
2016-12-02 10:48 AugustoMauch Note Added: 0092016
2016-12-02 10:48 AugustoMauch Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker