Welcome to EMC Consulting Blogs Sign in | Join | Help

SSIS Junkie

SSIS: Using checkpoint files

There's a few other things to be aware about when using checkpoint files that BOL does not tell you. Some of these may be obvious but its worth stating them anyway.:

  1. An OnPreExecute event on the package will not execute if the package is restarted using a checkpoint file (Proof is here: http://blogs.conchango.com/Admin/ImageGallery/blogs.conchango.com/jamie.thomson/20060104OnPreExecute_will_not_fire.zip).
  2. Specifying the name of a checkpoint file is not enough to make the package use it. You must set CheckpointUsage=IfExists as well. This is simple to do but also simple to forget to do.
  3. Variable values are persisted in the checkpoint file...
  4. ...all except for variables of type Object
  5. Properties set by a configuration are persisted in the checkpoint file
  6. Setting CheckpointUsage=Always has no practical use. (Not that I can envisage anyway - I stand to be corrected.)
  7. A ForEach loop will iterate over all items in a collection regardless of whether the package previously failed during iteration. In other words, the checkpoint file does not store information about how many iterations the ForEach loop has gone through
  8. The same is not true of the For Loop because this is dependant on variable values which are persisted in the checkpoint file
  9. If you want to test your checkpoints you'll need to make a task fail at some point. A useful but safe method of doing this is to drop a script task into your control-flow that references a non-existent variable in the ReadOnlyVariables property. This won't damage anything external to the package and, crucially, won't cause a validation error either

-Jamie

 

Published 03 January 2006 15:19 by jamie.thomson

Comments

 

aaronakin said:

Jamie,

In item #8, it sounds like you are saying that since the value of the variable used in evaluating the For Loop condition are saved to the checkpoint file, the loop should start at the iteration from the last point of failure.  (ie, if the loop failed on the 2nd iteration and the package was restarted, the 1st iteration would be skipped and it would go straight to the 2nd iteration.)

I cannot seem to get this to work.  I've tried everything.  The value of the variable is indeed being saved to the checkpoint, but when i restart the package, it uses the default value of the variable instead of the value from the checkpoint.

Have you ever confirmed the functionality of FLCs with checkpoints?

December 29, 2008 18:48
 

jamie.thomson said:

aaron,

Does the same problem (i.e. the variable's default value is used) occur when the variable i NOT used in a For Loop?

-Jamie

January 1, 2009 16:19
 

aaronakin said:

No, it doesn't.

I believe I found the answer though.  I think For Loop Containers are handled similarly to Foreach Loop Containers in that they are not restartable to the granularity of a specific iteration...unless, maybe, when you have custom logic in script tasks.

Although it logically seems like this should work in a For Loop when it is just incrementing a variable, if the loop used a boolean variable to iterate until the variable was false, SSIS wouldn't be able to figure out the number of iterations the loops has gone through when the package restarts.

-A

January 6, 2009 15:52
New Comments to this post are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems