SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Transactions in SQL Server 2005 Integration Services


Transactions in SQL Server 2005 Integration Services

Author
Message
Jamie Thomson
Jamie Thomson
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1981 Visits: 188
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/jthomson/transactionsinsqlserver2005integrationservices.asp

Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
P Pisarek
P Pisarek
Grasshopper
Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)Grasshopper (14 reputation)

Group: General Forum Members
Points: 14 Visits: 6
This would also by inference mean that there is no such thing as nested transactions? Or is there another mechanism that could be employed for that?
Jamie Thomson
Jamie Thomson
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1981 Visits: 188

Good question, and coincidentally one that I was asked yesterday by a colleague upon reading the article.

You are correct, nested transactions are not supported. This would be an interesting feature request for future versions althought I would fear that this would impact the inherent simplicity of the current behaviour.

Perhaps this could be handled via a new setting for TransactionOption, 'SupportedNested' or something similar.

Regards



Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
KyawAM
KyawAM
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 4

Hi,

I am having some problem with SSIS transaction. Eventhought I tried to imitate the concept that Jamie presented. My workflow is as followed

*********************************

For Each ADO.Record in Oracle (transaction=not supported)

If (Certain_Field_Value = 'A')

Lookup Data in SQL DB with values from Oracle (transaction=not supported)

DO Sequence A (Start a Transaction , transaction=required)

INSERT/UPDATE some records in SQLDB(transaction=supported)

Finish Sequence A ( transaction should stop here)

UPDATE Oracle DB ( Execute SQLTask, transaction=not supported)

If (Certain_Field_Value = 'B')

Lookup Data in SQL DB with values from Oracle (transaction=not supported)

DO Sequence B (Start a Transaction , transaction = required)

INSERT/UPDATE some records in SQLDB (transaction=supported)

Finish Sequence A ( transaction should stop here)

UPDATE Oracle DB ( Execute SQLTask, transaction=not supported)

If (Certain_Field_Value = 'C')

------------

------------

End ForEach Loop

*************************************

My requirements are that I want separate transaction for each Sequence A, B, C, etc... If Sequence A transaction fails, the other should still be continuing with another transaction.

But I am getting an error regarding the OLEDB Error in next Task (e.g in Certain_Field_Value = 'B') "Lookup Data in SQL DB with values from Oracle ", the error message is ".......Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction. ".

What is it the I am doing wrong?

Regards

KyawAM


noeld
noeld
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15788 Visits: 2048
Nested transactions are complex and "dangerous". There is a raw limit of 32 on the maximum nested level (on both SQL Server 2000 and 2005) which you can hit if you are not careful. Triggers complicate this things further and therefore the logic on the client code gets really convoluted.

I beleive those reasons should be enough for keeping you from getting into the nested transactions world. I have been there and it is really ugly. Most non trivial applications employ the single transaction model for speed and clarity.

Good Luck,


* Noel
Jamie Thomson
Jamie Thomson
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1981 Visits: 188

Hi there Noel,

In this case the transactions are handled by DTC. Does the same still aply?

-Jamie



Jamie Thomson
http://sqlblog.com/blogs/jamie_thomson
omhoge
omhoge
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1058 Visits: 183
Jamie, thanks for adding "In this case the transactions are handled by DTC."
I've been trying to find out what kind of trans. the Sequence Container used.

We've had issues with DTC in the past.

If need be, is there a way to use SQL Transactions with the Sequence Container?

much appreciated! - John

Skål - jh
WFBETC
WFBETC
Valued Member
Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)Valued Member (71 reputation)

Group: General Forum Members
Points: 71 Visits: 22
I am thinking that SSIS DTC does not really work or that there are some special attributes
that tasks contained in a sequence with transaction=required, that these tasks need to
have. Is sequentiality and same-thread guaranteed for all tasks in a sequence? I'm getting
failures on the first task in a transactioned sequence for no reason, am tempted to bag
SSIS/DTC and go with the literal BEGIN TRANSACTION ( which would involve redesigning
the whole loop -- arrgghh )
omhoge
omhoge
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1058 Visits: 183
Since this issue, in other packages I've built,
I have found that if in the same package,
there is a truncate task of the same table I am loading
then DTC will lock up, but SQL transactions will not.

If that is your situation, you might try putting the truncate in a separate package all together and then use a master controller package to control the flow from truncate to loading packages.

But I have had DTC hang on that server even without the truncate task and have been tending to avoid it.

hth

Skål - jh
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search