I'm using Symmetricds between a client and a server. The client can have a different structure (less columns).
In this case, I want to empty one column, and to use the latest created column on the server.
EG. Client has only column A. Server has column A and column B. When he updates a record, and sends it to the server, I want to write null into the A column and a value in the B column.
I'm trying to use the DatabaseWriterFilterAdapter beforeWrite function. I use a code similar to this one:
table.addColumn(new Column("B"));
parsedData[table.getColumnIndex("B")] = "NEWTEXT";
data.removeAllData(CsvData.ROW_DATA);
data.putParsedData(CsvData.ROW_DATA, parsedData);
context.setData(data);
I get this error:
Failed to load batch 14f76769-b759-4844-a0d0-f8e829cb569d-3589 StackTraceKey.init [IllegalStateException:2681352872]
java.lang.IllegalStateException: Invalid state while parsing csv data. The number of columns (11) reported for table 'public.tabletest' doesn't match up with the token count (11) data: {update,2fa94556-73b8-4998-a27b-169766afc6bb,beaa6b4d-1151-4e37-9c21-f0b878b6a55b,cd91b26f-1597-4e1b-8331-1f29241a434a,xxx,0,84,2015-04-08 17:49:28.214000,09431a0f-ca8d-4252-9b53-66529066115d,2021-09-21 16:32:27.995000,2fa94556-73b8-4998-a27b-169766afc6bb}
at org.jumpmind.symmetric.io.data.reader.ProtocolDataReader.readNext(ProtocolDataReader.java:183)
at org.jumpmind.symmetric.io.data.reader.ProtocolDataReader.nextData(ProtocolDataReader.java:348)
at org.jumpmind.symmetric.io.data.DataProcessor.forEachDataInTable(DataProcessor.java:191)
at org.jumpmind.symmetric.io.data.DataProcessor.forEachTableInBatch(DataProcessor.java:170)
at org.jumpmind.symmetric.io.data.DataProcessor.process(DataProcessor.java:116)
at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$1.call(DataLoaderService.java:975)
at org.jumpmind.symmetric.service.impl.DataLoaderService$LoadIntoDatabaseOnArrivalListener$1.call(DataLoaderService.java:950)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
How can I add the column's values the right way?