cancel
Showing results for 
Search instead for 
Did you mean: 

HANA SDI - HelloWorld Adapter skipping rows

0 Kudos

I'm running HANA Express and have a custom SDI adapter. When I create a table replication task and multiple rows are inserted, only the first row is written to HANA. For simplicity sake I modified the HelloWorld Adapter from github to demonstrate this. I changed the code to insert two rows every 5 seconds:

AdapterCDCRowSet rows = new AdapterCDCRowSet(spec.getHeader(), columns);
for(int i=0;i<2;i++) {
  AdapterCDCRow row = rows.newCDCRow(RowType.INSERT);
  row.setColumnValue(0, rowcount);
  row.setColumnValue(1, "Millis: " + System.currentTimeMillis());
  row.setTransactionId(transactionid);
  row.setSeqID(sequence);
  rowcount++;
}
receiverconnection.sendRowSet(rows);
System.out.println(rows.toString(true));

However, when I run this only the first row is inserted.

consoleouttxt.txt

I'm attaching the full source code and the debugging output.

0 Kudos

Playing with this some more there seems to be a problem with the handling of sequence IDs. I thought I could use the same sequence ID for inserting multiple rows but I was mistaken. If I have a new sequenceId for every row this works. However, I can't simply have

row.setSeqID(new SequenceId(System.currentTimeMillis()));<br>

since rows are added faster then every millisecond. The RealtimeTestAdapter in github handles the sequenceId's this way but will drop rows because of it. I tried starting with a sequenceId of 0 and incrementing with every new row but no rows were added. Any advice on how to manage sequenceId's?

Accepted Solutions (0)

Answers (0)