Announcement Announcement Module
Collapse
No announcement yet.
Rolling back a whole JOB Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rolling back a whole JOB

    Let say I start processing record from the db, writing out to file, and writing back to the db for audit purposes.

    Lets say something went wrong somewhere in this procedure, Is it possible to roll back the whole job (As if it never happened).

    Right now I have a commit interval of 100.


    So let say after 20000 items I get an error, can I roll back all 20000, even though they have now been committed?

  • #2
    Like this?

    http://forum.springframework.org/showthread.php?t=69451

    It's not a mainstream feature because rolling back an arbitrarily large dataset is *very* expensive. So be careful.

    Comment


    • #3
      How would this affect normal chunk oriented rollback and restart semantics, because that is my next step next week.

      Comment


      • #4
        It would bypass completely the standard semantics - no point in restartability if you are going to rollback on a failure. Transaction timeout will also be a factor - you need to have a small job for this to make sense.

        If that isn't the case then you are going to have to look at a normal set up with compensating transactions. Staging can help as well - prepare everything in a staging area with standard retry and restart semantics, and then bulk copy it in one go if possible when successful.

        Comment


        • #5
          my job is definitely too big for this. I will have to think about your "staging idea" that might complicated thing considerably for the job.

          Comment

          Working...
          X