Welcome to EMC Consulting Blogs Sign in | Join | Help

SSIS Junkie

SSIS: The container hierarchy

In the dim and distant past I wrote a blog entry that attempted to explain the concept of containers in an SSIS package. Following a post from Paul Pisarek this evening on the SSIS forum I thought it might be beneficial to expand on the concept a little.

Hopefully after reading the blog entry linked to above you are familiar with how a package is, in essence, a hierarchy of containers with the package container itself at the root of that hierarchy. You may think that if you have an SSIS solution that contains a master package and multiple other packages being called using the Execute Package Task then your solution consists of multiple seperate container hierarchies with no relationship to each other. Well actually...this is not the case!!!

A package container is the root of that package's container hierarchy yes, but put multiple container hierarchies together and what do you get? Answer: One single container hierarchy spanning multiple packages - effectively comprising many smaller container hierarchies in each package. The package container of each package executed via the Execute Package Task is a child of the TaskHost container of the Execute Package Task that executed it.

Why is this important? Well, for a number of reasons actually.

  • Events raised in a package executed via the Execute Package Task will propogate up the container hierarchy and can be handled by an eventhandler in a different package.
  • Therefore an event can be handled by more than one package (i.e. Not one or the other).
  • Setting DisableEventHandlers=FALSE in the package that raises an event does NOT ensure that an event will not get handled by an eventhandler - as Paul found out to his cost :)
  • Containers are integral to how transactions operate in SSIS. The fact that a container hierarchy can span multiple packages means that transactions can do so as well. In other words we can commit or rollback multiple operations over multiple RDBMSs that are executed from multiple packages. That's fantastically powerful stuff! You can read a bit more about this here.

-Jamie

 

Published 13 July 2005 22:33 by jamie.thomson

Comments

 

Mune said:

Nice blog!
September 17, 2005 10:33
 

Jamie Thomson - Life, the universe and SSIS! said:

January 18, 2006 21:22
 

Jamie Thomson - Life, the universe and SSIS! said:

January 18, 2006 21:25
 

Jamie Thomson - Life, the universe and SSIS! said:

January 20, 2006 15:09
 

Jamie Thomson - SSIS Jibber Jabber said:

I thought it would be worth publishing a list of guidelines that I see as SSIS development best practices....
May 25, 2006 13:02
 

SSIS Junkie said:

I thought it would be worth publishing a list of guidelines that I see as SSIS development best practices.

November 8, 2006 21:55
 

Robert Harmon said:

I understand the whole concept of the container and how it comes into play inside SSIS.  My question is about the handling of events of parent - child packages.

I have a master package that calls 3-5 different sub packages.  I built each package from a template.  The template has event logging to a database for post-execute, on-information, and pre-execute.  If the parent package controls the logging should I actaully remove the event logging from the child packages?

Thanks,

Robert

February 8, 2008 03:51
 

jamie.thomson said:

Robert,

I would never say "you should", but all the events from the child packages will get caught in the master so,yes, you definitlay have that option.

-Jamie

February 8, 2008 08:34
 

Robert said:

Thanks

February 25, 2008 13:23
 

Rasik Fulzele said:

Do event handlers have scope?

I've a sequence container and 2 DFTs inside sequence container. I've a variable scoped to the sequence container and that variable is populated through script task in onError event handler defined at the sequence container level.

Script task is placed in onError expecting variable is populated pass/fail if DFT(s) fail. But when I execute the sequence container and even though DFT fail, the onError script task is not executed and the variable is not populated.

How to populate the variable through event handler?

Thanks

June 3, 2008 13:46
 

jamie.thomson said:

Rasik,

Not sure, this sounds like it should work. Are you perhaps right-clicking on the Sequence Container and selecting "Execute Container" as opposed to running the whole package?

-Jamie

June 4, 2008 11:02
 

SSIS Junkie said:

In my blog entry Custom Logging Using Event Handlers from June 2005 I described an easy technique for

June 8, 2008 12:42
New Comments to this post are disabled

This Blog

Syndication

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