Alberto Ferrari

SQL Server 2005, BI, SSIS and SSAS.

<October 2008>
SuMoTuWeThFrSa
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678


Navigation

Images

Subscriptions

Post Categories



Data Flow Components, constructors and SSIS

Yesterday I had to fix a simple still subtle bug in TableDifference, I think sharing the experience will be useful for everybody involved in custom component creation.

The component has some fields that are initialized in the component constructor, at the end of the work the component does not clear them as I would expect the object to be destroyed by the SSIS engine. Everything works fine until you run the component in a data flow task contained in a foreach loop then... bang! the component crash.

The problem is that the component was not fresh-built but contained properties with the same data that were there at the end of its first execution. It seems to me that SSIS does not destroy components after a data flow terminates but reuses them during the subsequent runs of the same data flow task recalling their pre-execute method. I solved the problem clearing variable values in the pre-execute method, the problem is solved but I don't like the way the SSIS engine works, I would really like an object to be destroyed and then recreated when the container data flow task finishes execution.

If confirmed (is anybody from Microsoft listening?) this behaviour is - in my opinion - very interesting but wrong. You can decide to use this behaviour to implement some sort of state management in a component but in the same time you are prone to very nasty bugs if you do not clear all your properties in the pre-execute method and then initialize them to a meaningful value.

I did not found useful documentation about this behaviour, has anybody done any kind of investigation about it?

posted on Monday, July 31, 2006 1:35 AM by AlbertoFerrari


# re: Data Flow Components, constructors and SSIS @ Sunday, August 06, 2006 3:14 PM

Hi Alberto,
Microsoft Connect is the place to go to tell MSFT about this stuff. And I can highly recommend the "Send Feedback" link of BOL - those emails really do have an effect.

-Jamie

Jamie Thomson

# re: Data Flow Components, constructors and SSIS @ Wednesday, August 09, 2006 1:14 PM

Where did you get your background information to create a custom component? I've been scouring the web trying to find out how to create an SSIS data transformation component.

I have incoming text files that have to be processed to determine if each data record is new and needs to be added to the various database tables or if the data record contains data that has changed and update the corresponding tables.

There will be various sources of data that have their own particular structures (requiring their own SSIS packages) and they all will be combined into a common database structure.

Can you point me in the right direction?

Aaron N. Cutshall

# re: Data Flow Components, constructors and SSIS @ Thursday, August 10, 2006 3:23 PM

Aaron, you can easily reach me via mail on sqlbi.eu (alberto.ferrari), I'll be glad to help you.

All the information is available from Microsoft in the help and in variuos custom components they provided as samples, maybe TableDifference is a good start for you... anyway, I'll look forward for your e-mail.

Alberto

AlbertoFerrari




Powered by Dot Net Junkies, by Telligent Systems