View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002968 | SymmetricDS | Bug | public | 2017-01-24 12:46 | 2017-02-01 16:19 |
Reporter | wluciano | Assigned To | chenson | ||
Priority | normal | ||||
Status | closed | Resolution | fixed | ||
Product Version | 3.8.14 | ||||
Target Version | 3.8.15 | Fixed in Version | 3.8.15 | ||
Summary | 0002968: java.lang.NullPointerException in getForeignTableRows when foreign key is null | ||||
Description | [gruposidra-cloud] - AcknowledgeService - The outgoing batch node01-0000 failed: [FK,-900] The INSERT statement conflicted with the FOREIGN KEY constraint "FK_TB1_TB2". The conflict occurred in database "DB01", table "dbo.TB2", column 'Oid'. [xxx] - DataService - reloadMissingForeignKeyRows for nodeId 'node01' dataId '1' table 'TB1' [gruposidra-cloud] - SymmetricServlet - Error while processing POST request for externalId: null, node: node01 at xxx.xxx.xxx.xxx (xxx.xxx.xxx.xxx) with path: /xxx/ack [xxx] - SymmetricServlet - java.lang.NullPointerException at org.jumpmind.util.LinkedCaseInsensitiveMap.putAll(LinkedCaseInsensitiveMap.java:109) at org.jumpmind.symmetric.service.impl.DataService.getForeignTableRows(DataService.java:1634) at org.jumpmind.symmetric.service.impl.DataService.reloadMissingForeignKeyRows(DataService.java:1565) at org.jumpmind.symmetric.service.impl.AcknowledgeService.ack(AcknowledgeService.java:129) at org.jumpmind.symmetric.web.AckUriHandler.ack(AckUriHandler.java:69) at org.jumpmind.symmetric.web.AckUriHandler.handle(AckUriHandler.java:64) [gruposidra-cloud] - ConcurrentConnectionManager - Reserving connection for /sync/gruposidra-cloud/push paradaRomanaEX | ||||
Steps To Reproduce | When one node tries to reload missing ForeignKeyRows, if the values of the foreign columns are null, in one of the referenced tables, the system don't validate that and tries to put a null result to the list. | ||||
Additional Information | I applied a temporary fix to this: From this: Row foreignRow = new Row(foreignTable.getColumnCount()); if (foreignTable.getForeignKeyCount() > 0) { DmlStatement selectSt = platform.createDmlStatement(DmlType.SELECT, foreignTable, null); Map<String, Object> values = sqlTemplate.queryForMap(selectSt.getSql(), whereRow.toArray(foreignTable.getPrimaryKeyColumnNames())); foreignRow.putAll(values); To this: Row foreignRow = new Row(foreignTable.getColumnCount()); if (foreignTable.getForeignKeyCount() > 0) { DmlStatement selectSt = platform.createDmlStatement(DmlType.SELECT, foreignTable, null); Map<String, Object> values = sqlTemplate.queryForMap(selectSt.getSql(), whereRow.toArray(foreignTable.getPrimaryKeyColumnNames())); if (values != null) { foreignRow.putAll(values); } | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2017-01-24 12:46 | wluciano | New Issue | |
2017-01-25 12:44 | chenson | Assigned To | => chenson |
2017-01-25 12:44 | chenson | Status | new => assigned |
2017-01-25 12:45 | chenson | Fixed in Version | => 3.8.15 |
2017-01-25 12:45 | chenson | Target Version | => 3.8.15 |
2017-01-25 12:45 | chenson | Status | assigned => resolved |
2017-01-25 12:45 | chenson | Resolution | open => fixed |
2017-01-25 13:00 | chenson | Changeset attached | => SymmetricDS 3.8 73b3a916 |
2017-02-01 16:19 | chenson | Status | resolved => closed |