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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036742
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServermajorhave not tried2017-08-29 15:462017-09-02 23:45
ReportermtaalView Statuspublic 
Assigned Tomtaal 
PrioritynormalResolutionopenFixed in VersionRR17Q4
StatusclosedFix in branchFixed in SCM revision4b7ec6d22152
ProjectionnoneETAnoneTarget VersionRR17Q4
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

0036742: PartialExclusionWriterFilterAdapter only restores columns but not row data in afterwrite

DescriptionIn 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 [^]
Steps To ReproduceCheck a table with partially excluded columns
Create a writer filter adapter which does getColumnIndex
Check that getColumnIndex returns the wrong value
Proposed SolutionKeep the original rowData and oldData also in the context and restore in afterwrite.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0098709)
hgbot (developer)
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 (manager)
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 (developer)
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 (manager)
2017-09-02 23:45

Reviewed

- Issue History
Date Modified Username Field Change
2017-08-29 15:46 mtaal New Issue
2017-08-29 15:46 mtaal Assigned To => mtaal
2017-08-29 15:46 mtaal Triggers an Emergency Pack => No
2017-08-29 16:26 mtaal Review Assigned To => AugustoMauch
2017-08-29 16:27 hgbot Checkin
2017-08-29 16:27 hgbot Note Added: 0098709
2017-08-29 16:27 hgbot Status new => resolved
2017-08-29 16:27 hgbot Resolution open => fixed
2017-08-29 16:27 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/4b7ec6d22152fd28511654457a09334ba3c5dd22 [^]
2017-08-31 11:28 AugustoMauch Note Added: 0098750
2017-08-31 11:28 AugustoMauch Status resolved => new
2017-08-31 11:28 AugustoMauch Resolution fixed => open
2017-09-01 12:30 hgbot Checkin
2017-09-01 12:30 hgbot Note Added: 0098773
2017-09-01 12:30 hgbot Status new => resolved
2017-09-01 12:30 hgbot Resolution open => fixed
2017-09-01 12:30 hgbot Fixed in SCM revision http://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:30 AugustoMauch Review Assigned To AugustoMauch => mtaal
2017-09-01 12:30 AugustoMauch Status resolved => new
2017-09-01 12:30 AugustoMauch Resolution fixed => open
2017-09-01 12:30 AugustoMauch Fixed in SCM revision http://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:30 AugustoMauch Status new => scheduled
2017-09-01 12:31 AugustoMauch Status scheduled => resolved
2017-09-02 23:45 mtaal Note Added: 0098781
2017-09-02 23:45 mtaal Status resolved => closed
2017-09-02 23:45 mtaal Fixed in Version => RR17Q4


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker