Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


IsolationLevel = Snapshot, TransactionOption = Required


IsolationLevel = Snapshot, TransactionOption = Required

Author
Message
Martin Gleeson
Martin Gleeson
SSC-Enthusiastic
SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)

Group: General Forum Members
Points: 168 Visits: 277
For love nor money, we can't get this to work. I'm trying this oh so simple example on a dev box with SQL Server 2005 Developer Ed. SP2 , Windows XP SP2.

The Source Database:
Use master

ALTER DATABASE MyDB
SET ALLOW_SNAPSHOT_ISOLATION ON
GO


The Package:
1) Create a package, any name will do.
2) Create a new OLE DB connection with default settings to a database on local SQL Server 2005 SP2 Dev Ed. which you are a SysAdmin of.
3) Add an "Execute SQL Task" to the Control Flow. (I only chose this to keep it simple but any component will do). Edit the SQL Task to "select count(*) from SomeTable". This won't do anything particularly useful but should just connect to the database, count the rows in the table and return a success.
4) Right click the SQL Task component and select properties.
5) In the properties pane, set the IsolationLevel property to "Snapshot"
6) Set the TransactionOption property to "Required".
7) Execute the package.

Every time this fails with:

[Execute SQL Task] Error: Failed to acquire connection "(local).MyDB". Connection may not be configured correctly or you may not have the right permissions on this connection.

[Connection manager "(local).MyDB"] Error: The SSIS Runtime has failed to enlist the OLE DB connection in a distributed transaction with error 0x8004D00A "Unable to enlist in the transaction.".

[Connection manager "(local).MyDB"] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x8004D00A.

Please note: MSDTC is running and security configuration has been configured as:
Network DTS Access = 1
Allow Remote Clients = 1
Allow Remote Administration = 1
Allow Inbound = 1
Allow Outbound = 1
Mutual Authentication Required = 1
Enable Transaction Internet Protocol (TIP) Transactions = 1
Enable XA Transaction = 1
Account: NTAUTHORITY\NETWORK SERVICE

SSIS service is running under NTAUTHORITY\NETWORK SERVICE.

I'm a sysadmin, even tried making ntauthorityetwork service a sysadmin. Nothing. Fail fail fail. If I change the IsolationLevel to anything else this runs fine. I've been here http://support.microsoft.com/kb/914375 but I'm running SP2!

Have I completely missed something here? Blink
Michael Earl-395764
Michael Earl-395764
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3169 Visits: 23078
Let's see if it is really the snapshot isolation level, or just your DTC configuration.
Create a second ExecuteSQL task in the package and set the package to require transaction as well as the secons ExecuteSQL task (to ensure they are both added to the same transaction by DTC).
Do not turn on the snapshot isolation and see if you get the DTC error. With a single component, DTC does not really need to create a distribute transaction, so you may only be seeing an error because it has to start one to support the snapshot isolation.
If you get a DTC error with a second component in your transaction and snapshot isolation off, your DTC configuration is incorrect (it is pretty touchy to set up, so this is likely).
Martin Gleeson
Martin Gleeson
SSC-Enthusiastic
SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)

Group: General Forum Members
Points: 168 Visits: 277
Hi Michael, thanks for the quick response!

As you suggested, I have added a second Execute SQL Task configured in exactly the same way as the first one described previously except, also as requested:

IsolationLevel = ReadCommited
Transaction Option = Required

The package ran OK (both components start, turn yellow and run at the same time, go green, no errors). Looks like MSDTC is set up ok.

I change the settings on both components back to:

IsolationLevel = Snapshot
Transaction Option = Required

And it fails.

I tried both these article but the problem persists:
http://support.microsoft.com/kb/839279/en-us
http://support.microsoft.com/kb/329332/en-us
Martin Gleeson
Martin Gleeson
SSC-Enthusiastic
SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)

Group: General Forum Members
Points: 168 Visits: 277
Is anyone else able to reproduce this?

Has anyone else been able to force a required snapshot transaction with SSIS?

Cheers,
Martin
Martin Gleeson
Martin Gleeson
SSC-Enthusiastic
SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)SSC-Enthusiastic (168 reputation)

Group: General Forum Members
Points: 168 Visits: 277
*sigh* I'm losing the plot here. Crying

Snapshot isolation cannot be used within distributed queries.

http://msdn2.microsoft.com/en-us/library/ms188277.aspx

"For most applications, read committed isolation using row versioning is recommended over snapshot isolation for the following reasons:

* It consumes less tempdb space than snapshot isolation.
* It works with distributed transactions, whereas snapshot isolation does not.
* It works with most existing applications without requiring any change. Applications written using the default isolation level, read committed, can be dynamically tuned. The behavior of read committed, whether to use row versioning or not, is determined by the database option setting, and this can be changed without affecting the application."

Seeing as how what we want is to run a SSIS package within a single snapshot transaction and SSIS uses the MSDTC to manage transactions but snapshot isolation is not supported in distributed queries... does that logic flow?

If something does not support distributed queries does that mean it does not support distributed transactions?
sharon.bender
sharon.bender
SSC-Enthusiastic
SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)SSC-Enthusiastic (133 reputation)

Group: General Forum Members
Points: 133 Visits: 164
Hmmm... I thought that the read-committed row-versioning (as opposed to JUST row versioning without the read-committed option) would allow distributed transactions and distributed queries.

But maybe it was just the former, and not the latter.

From the posts I have seen, you need to turn on the read-committed before changing the isolation level to row versioning.
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