Announcement Announcement Module
No announcement yet.
'Uptdate' method of ItemStream and rollback Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 'Uptdate' method of ItemStream and rollback


    My Writer (FlatFileWriter) implements the 'update' and 'open' methods of the ItemStream class. I know that the update method is called after the writing of the chunk is fnished but NOT yet committed. So this gives us a guarantee that if saving of the state in the update method itself fails, our just written chunk will also be rolled-back. This seems to be working as I have tested it.

    Now what I am noticing is that if I have placed something in the ExecutionContext in the update method of ItemStream in the Writer class, that stuff or those values are not rolled back or discarded if there was in Exception in the update method. How I simulated this was that in the update method:

    public void update(ExecutionContext ec)  throws ItemStreamException {
       //...Do stuff
       ec.putLong("restart_value", 1);
       //...Do stuff
       throw new RuntimeException("dummy");
       super.update(ec);//What if exception occurs within this?
    Now when the exception is thrown then my last written chunk is successfully rolled back but on the restart I get the value 1 for "restart_value" attribute. Shouldn't this be discard as well? Or I have to roll back or clear the Execution Context myself?

    What is exception occurs within super.update where I do not have any control? Please advise. Thanks.

  • #2
    this seems to be related to: