Skipping records with StaxEventItemReader
I'm trying to get SkipLimitStepFactoryBean to work with StaxEventItemReader but can't seem to get it right.
I've setup a skip limit step which uses a StaxEventItemReader as a reader. When a skippable exception is thrown out of my deserializer, the record number is added to the reader skipRecords list, the chunk iteration is terminated and a new step iteration starts.
Right before processing a new chunk, ItemOrientedStep calls itemHandler.mark() which delegates to StaxEventItemReader which clears the skipRecords list, so StaxEventItemReader will only progress to the end of the current fragment and think there are no more fragments to process.
Is this a bug or did I get it wrong?
I think either the reader should be seeked to the next fragment before calling mark(), or the skip limit exception handler should be set on the chunkOperations instead of the stepOperations.
Think before you loop records
One of the greatest feature of Servoy is that, you can directly interact with the database by using Servoy’s built-in data binding for creating/modifying/editing/searching records using a particular form. This Tip will address one of the important things while looping through the records of your form.
We can modify/update the record data of a form by looping through its records. So, we are generally following the below code to do the same.
// loop through the records
var count = 1;
var maxCount = controller.getMaxRecordIndex();
for(var count=1; count<=maxCount; count++) {
// select the record
controller.setSelectedIndex(count);
/* Do any operations with the
selected record */
}
For more information refer