difference between on-error event handler and precedence constrain "failure"

Is there any differene between on-error event handler and precedence constrain failure? I have created a package and if a data flow task(flat file to DB) fails, the file has to be moved to archive folder. How I have accomplished this is

Dataflow task->precedence constrain failed(red arrow)->execute process task to move the file to error folder and it worked,

The same execute process task( to move the file to error folder) doesnot work  when I move this to on-error event handler. Any idea why this behaviour? Also, for the same file the on-error event is getting triggered multiple times.

Thanks,

Nikesh

September 1st, 2015 1:53pm

Hi Nikesh,

How do you move is probably by a file task I guess and in this case the file remains locked.

So you get an error there that indicates that. But the event handler for the OnError on this failed task fires once only.

The proper design is to the Precedence Constraint.

Free Windows Admin Tool Kit Click here and download it now
September 1st, 2015 2:08pm

Thank you, my only problem with using precedence constraint is that I can't use the errorcode and error description to log into an audit table, these variables will be accessible only from event handler.
September 2nd, 2015 12:06am

My personal preference would be for the error event handler for handling error processing and precedence constraints for flow control - file handling can be considered flow control so neither here nor there really. However, to resolve your issue, you could either do all the logging within your error handler and then move the file based on precedence constraints or set global variables in your event handler and log in the precedence constraints along with moving the file
Free Windows Admin Tool Kit Click here and download it now
September 2nd, 2015 12:25am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics