MSDTC on server 'XXXXXX' is unavailable.

MSDTC on server 'XXXXXX' is unavailable.

Old forum URL: forums.lhotka.net/forums/t/1833.aspx


tseveryn posted on Sunday, November 26, 2006

Hi,

 

I've gotten rid of the GUID as the ProjectID in PTracker, and replaced it with datatype INTEGER.

 

Made corresponding changes to the database. [Running everything locally.]

 

Modified PROJECT class and its child collection the same way it is done for RESOURCE.

 

Can successfuly create new project(s) without children, however when trying to assign resources to it - i'm getting the following error:

 

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

Error saving

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

System.Data.SqlClient.SqlException: MSDTC on server 'XXXXXXX' is unavailable.    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)    at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()    at System.Data.SqlClient.SqlDataReader.get_MetaData()    at System.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj)    at System.Data.SqlClient.TdsParser.GetDTCAddress(Int32 timeout, TdsParserStateObject stateObj)    at System.Data.SqlClient.SqlInternalConnectionTds.GetDTCAddress()    at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)    at System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx)    at System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction)    at System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction)    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)    at System.Data.SqlClient.SqlConnection.Open()    at PROJECTTRACKER.Library.ProjectResource.Insert(Project Project) in C:\WorkSpace\PROJECTTRACKER\PROJECTTRACKER.Library\ProjectResource.vb:line 183    at PROJECTTRACKER.Library.ProjectResources.Update(Project Project) in C:\WorkSpace\PROJECTTRACKER\PROJECTTRACKER.Library\ProjectResources.vb:line 143    at PROJECTTRACKER.Library.Project.DataPortal_Update() in C:\WorkSpace\PROJECTTRACKER\PROJECTTRACKER.Library\Project.vb:line 403

 

 

Something is still there since it tries to invoke MSDTC (Microsoft Distributed Transaction Coordinator)..

 

Any help would be greatly appreciated.

 

 

Thank you very much,

Teresa Severyn

 

 

 

ajj3085 replied on Monday, November 27, 2006

Sounds like your using transaction scope transactions, and are opening more than one database connection within the scope.

Kahn replied on Thursday, November 30, 2006

Which version of windows are you running? But default the install of VS on Windows XP MSDTC is automatically installed and you would never see this error.

To check if MSDTC is installed (highly unlikely since your getting this error)

Go to start-->Control panel--->Administrative Tools-->Services--->You should see an entry there for distributed transaction server service turn it on if it's off.

Give me some more info and I can assist as I have had several problems with MSDTC.

ajj3085 replied on Friday, December 01, 2006

MSDTC as far as I know is part of the OS, you can't uninstall it.

I wouldn't recommend using the DTC unless you really have a need for it, because its quite a bit of overhead.  Instead, it would be better if we knew how he was attempting transactions. 

Most people with this error are using TransactionScope, and opening more than one connection within the scope.  Changing your code to use only one connection would correct this error and is a better solution, because you avoid the DTC.

Kahn replied on Thursday, December 21, 2006

Well msdtc is apart of some OSes in Windows Media Edition it's not apart of the OS.

Personally I havent find any adverse effects of using MSDTC. However I haven't done any major msdtc work.

Well whatever solution you try hope it works. :)

DansDreams replied on Thursday, December 21, 2006

MSDTC is required for TransactionScope on SQL versions prior to SQL 2005.  It is a resource hog.  I think the recommendation is avoid TransactionScope or upgrade to SQL 2005.

MRDPrince replied on Monday, April 18, 2011

Set the connection string property "Enlist=False" to avoid using MSDTC.

Copyright (c) Marimer LLC