I am trying to handle an error in a For-Loop container and have it continue in the loop, retrying the operation up to a defined number of times before finally failing.
I have a for-loop container that, within it, has a sequence container. The tasks in the sequence container are to copy a database, check to see that it copied successfully and, if so, move on. If it failed, it waits a defined period of time, then should loop, trying the copy again.
The For-Loop container, Sequence container, and Copy task each has MaximumErrorCount = 0. Each has an onerror event handler defined (with nothing in it), and the Propagate system variable set to False.
I am forcing the copy task to error by having the compatibility level set incorrectly on the database. Unfortunately, it seems that when it gets the copy error, it terminates the loop and moves on, apparently with success. However, the success precedence constraint on the For-Loop container is defined as a logical "and" that requires a success status, and a package level variable called CopySuccess to be set to true. That is done in the success constraint of the integrity check, which follows a successful copy of the database. The success constraint is apparently never getting executed, so I don’t understand how it continues as though it was successful.
The attached file shows screen shots of the package execution, and some details concerning the containers and variables.
Can anyone help me understand what I need to do to continue the loop when the copy task fails?
Many thanks! ETL.pdf