Go Back   CORTEX Forums > Local Happenings > CORTEX Blogs > BI Monkey
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

Event Handlers and Checkpoints

This is a discussion on Event Handlers and Checkpoints within the BI Monkey forums, part of the CORTEX Blogs category; I was recently playing with creating a Package based logging and auditing system using Event Handlers. The principle being that I would use the firing of the Event Handlers to ...


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 23rd June 2009, 09:34 PM   #1
Guru
 
Join Date: Jun 2009
Posts: 122
James Beresford is on a distinguished road
Thumbs up Event Handlers and Checkpoints

I was recently playing with creating a Package based logging and auditing system using Event Handlers. The principle being that I would use the firing of the Event Handlers to drive Inserts into a database table that could log package events. In doing so I came up against one problem I knew about and could work around and one that I didn’t that frustrated my plans. I have created a sample package which demonstrates both issues here

Why do Event Handlers fire multiple times?

Event handlers fire multiple times because they fire both at the package and control flow component level. If you run the sample package you will note that the OnPreExecute event fires 3 times - once for the package and once for each of the two steps on the control flow. If you want to control the Event Handler so that it only fires once at the package level, you need to precede any activity with a constraint that means it will only execute if System::SourceName = System::PackageName. I usually do this by just putting in a Script Task with no code as the preceding task on which to base the constraint - it will always succeed and doesn’t slow things down.

Which Event Handlers fire when resuming from a Checkpoint?

This one’s easy - none of them. This caught me slightly off guard, but the Checkpoint file resumes the package from the exact point at which it failed, and does not re-run already fired Event Handlers - if you run the sample package twice (once to fail, once to resume from the checkpoint) you’ll notice that first time you run it, my annnoying message boxes pop up showing all sorts of events firing. The second time you run it, it resumes from the precise point of failure - no validation, pre execution or even error events fire at all. Which means if, like me,* you want to log a package restarting from a checkpoint by using an event handler - you can’t!



More...
James Beresford is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTweet this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A2009 event highlights value of business analytics Latest News Headlines SAS Forum 0 5th May 2009 05:33 PM
Training and Event Announcements Steve Bennett Data Warehousing Tips and Techniques 2 15th July 2008 10:24 AM


All times are GMT +11. The time now is 10:23 AM.

© The Business Intelligence Group

Search Engine Optimization by vBSEO