Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036742Retail ModulesStoreServerpublic2017-08-29 15:462017-09-02 23:45
mtaal 
mtaal 
normalmajorhave not tried
closedopen 
5
 
RR17Q4RR17Q4 
mtaal
No
0036742: PartialExclusionWriterFilterAdapter only restores columns but not row data in afterwrite
In the PartialExclusionWriterFilterAdapter classs, in the beforeWrite method [1] both the rowData and the columns by table are corrected for excluded columns.

However, in the afterwrite [2] only the columns are restored.

Also now only rowData is corrected but also oldData should be corrected and restored.

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/9887808d7c40/src/org/openbravo/replication/symmetricds/extensions/PartialExclusionWriterFilterAdapter.java#l92 [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/9887808d7c40/src/org/openbravo/replication/symmetricds/extensions/PartialExclusionWriterFilterAdapter.java#l107 [^]
Check a table with partially excluded columns
Create a writer filter adapter which does getColumnIndex
Check that getColumnIndex returns the wrong value
Keep the original rowData and oldData also in the context and restore in afterwrite.
No tags attached.
Issue History
2017-08-29 15:46mtaalNew Issue
2017-08-29 15:46mtaalAssigned To => mtaal
2017-08-29 15:46mtaalTriggers an Emergency Pack => No
2017-08-29 16:26mtaalReview Assigned To => AugustoMauch
2017-08-29 16:27hgbotCheckin
2017-08-29 16:27hgbotNote Added: 0098709
2017-08-29 16:27hgbotStatusnew => resolved
2017-08-29 16:27hgbotResolutionopen => fixed
2017-08-29 16:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/4b7ec6d22152fd28511654457a09334ba3c5dd22 [^]
2017-08-31 11:28AugustoMauchNote Added: 0098750
2017-08-31 11:28AugustoMauchStatusresolved => new
2017-08-31 11:28AugustoMauchResolutionfixed => open
2017-09-01 12:30hgbotCheckin
2017-09-01 12:30hgbotNote Added: 0098773
2017-09-01 12:30hgbotStatusnew => resolved
2017-09-01 12:30hgbotResolutionopen => fixed
2017-09-01 12:30hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/4b7ec6d22152fd28511654457a09334ba3c5dd22 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/d571640791f01e577dc8095a1844b7defdfd0ca2 [^]
2017-09-01 12:30AugustoMauchReview Assigned ToAugustoMauch => mtaal
2017-09-01 12:30AugustoMauchStatusresolved => new
2017-09-01 12:30AugustoMauchResolutionfixed => open
2017-09-01 12:30AugustoMauchFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/d571640791f01e577dc8095a1844b7defdfd0ca2 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/4b7ec6d22152fd28511654457a09334ba3c5dd22 [^]
2017-09-01 12:30AugustoMauchStatusnew => scheduled
2017-09-01 12:31AugustoMauchStatusscheduled => resolved
2017-09-02 23:45mtaalNote Added: 0098781
2017-09-02 23:45mtaalStatusresolved => closed
2017-09-02 23:45mtaalFixed in Version => RR17Q4

Notes
(0098709)
hgbot   
2017-08-29 16:27   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 4b7ec6d22152fd28511654457a09334ba3c5dd22
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Aug 29 16:26:55 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/4b7ec6d22152fd28511654457a09334ba3c5dd22 [^]

Fixes issue 36742: PartialExclusionWriterFilterAdapter only restores columns but not row data in afterwrite
Store also rowData and oldData in context and restore in afterwrite

---
M src/org/openbravo/replication/symmetricds/extensions/PartialExclusionWriterFilterAdapter.java
---
(0098750)
AugustoMauch   
2017-08-31 11:28   
I get this error when synchronizing an INSERT done on a table that has a column excluded partially:

java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at java.util.Arrays$ArrayList.(Arrays.java:3813)
at java.util.Arrays.asList(Arrays.java:3800)
at scala.actors.threadpool.Arrays.asList(Unknown Source)
at org.openbravo.replication.symmetricds.extensions.PartialExclusionWriterFilterAdapter.excludeColumns(PartialExclusionWriterFilterAdapter.java:199)

The problem seems to be here [1]. In INSERTS CsvData.OLD_DATA will be null, and in DELETES CsvData.ROW_DATA will be null, so in both cases the exception will be thrown because Arrays.asList does not accept null values.

[1] https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/diff/4b7ec6d22152/src/org/openbravo/replication/symmetricds/extensions/PartialExclusionWriterFilterAdapter.java#l1.66 [^]
(0098773)
hgbot   
2017-09-01 12:30   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: d571640791f01e577dc8095a1844b7defdfd0ca2
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Sep 01 12:29:36 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/d571640791f01e577dc8095a1844b7defdfd0ca2 [^]

Fixes issue 36742: Refactors WriterFilterAdapter and prevents NPE

The following changes have been done:
- Clean up - refactors:
    * Code to obtain the list of partially excluded columns extracted to new method
    * Gather together the code that stores the back ups of the original table and data (row data and old data)
- Prevent NPE: Only invoke Arrays.asList(array) if the array is not null

---
M src/org/openbravo/replication/symmetricds/extensions/PartialExclusionWriterFilterAdapter.java
---
(0098781)
mtaal   
2017-09-02 23:45   
Reviewed