Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

IsolationLevel = Snapshot, TransactionOption = Required Expand / Collapse
Author
Message
Posted Tuesday, October 16, 2007 5:50 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, April 29, 2013 8:03 AM
Points: 166, 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?
Post #411216
Posted Tuesday, October 16, 2007 6:46 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 10, 2010 5:07 AM
Points: 2,661, Visits: 23,078
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).
Post #411248
Posted Tuesday, October 16, 2007 7:23 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, April 29, 2013 8:03 AM
Points: 166, 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

Post #411276
Posted Wednesday, October 17, 2007 7:27 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, April 29, 2013 8:03 AM
Points: 166, Visits: 277
Is anyone else able to reproduce this?

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

Cheers,
Martin
Post #411714
Posted Thursday, October 18, 2007 5:44 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, April 29, 2013 8:03 AM
Points: 166, Visits: 277
*sigh* I'm losing the plot here.

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?




Post #412151
Posted Wednesday, July 23, 2008 6:46 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Saturday, July 5, 2014 7:04 PM
Points: 95, 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.
Post #539793
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse