Results 1 to 5 of 5

Thread: Rolling back a whole JOB

  1. #1
    Join Date
    Mar 2009
    Posts
    130

    Default 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. #2
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    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.

  3. #3
    Join Date
    Mar 2009
    Posts
    130

    Default

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

  4. #4
    Join Date
    Jun 2005
    Posts
    4,241

    Default

    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.

  5. #5
    Join Date
    Mar 2009
    Posts
    130

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •