developers.de
daenet's .NET Community

DTC Transaction Manager (Exception from HRESULT: 0x80070005)

Damir Dobric Posts

 

Damir@Phone    



My upcoming sessions:

AppFabric Applications at
NRW Conf 2011
09.Sept.2011 Wuppertal

HTML5 widgets in WP7+
Monodroid
Mobility Day
21.Sept.2011 - Zagreb

AppFabric and WCF sessions at
Advanced Developer Conference
26.-27. Oktober 2011 in Frankenthal

AppFabric Applications, queues, topics and more at
Prio Conference
02. - 03. November 2011 in Meistersingerhalle Nürnberg

AppFabric Applications deep dive hosted by
.NET User Group Frankfurt
17.Nov.2011 18.30-22.30 Microsoft - Bad Homburg 

 

 

Error Description

When working with Ado.Net Entity Framework, you may get following error:

Exception: The underlying provider failed on Open.

   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

   at System.Data.EntityClient.EntityConnection.Open()

   at System.Data.Objects.ObjectContext.EnsureConnection()

   at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)

   at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()

   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)

   at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__1[TResult](IEnumerable`1 sequence)

   at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)

   at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.ExecuteSleep(Expression expression)

   at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)

   at Daenet.PresentationManagement.Database.PresentationManagementDal.GetLinkedContent(Guid slideId) in C:\nstorandt\Schmid\Daenet.PresentationManagementSolution\Daenet.PresentationManagementApi\Database\PresentationManagementDal.cs:line 396

InnerException ->Exception: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

   at System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeName, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeNameMatches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceManagerShim& resourceManagerShim)

   at System.Transactions.Oletx.DtcTransactionManager.Initialize()

   at System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory()

   at System.Transactions.TransactionInterop.GetOletxTransactionFromTransmitterPropigationToken(Byte[] propagationToken)

   at System.Transactions.TransactionStatePSPEOperation.PSPEPromote(InternalTransaction tx)

   at System.Transactions.TransactionStateDelegatedBase.EnterState(InternalTransaction tx)

   at System.Transactions.EnlistableStates.Promote(InternalTransaction tx)

   at System.Transactions.Transaction.Promote()

   at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction)

   at System.Transactions.TransactionInterop.GetExportCookie(Transaction transaction, Byte[] whereabouts)

   at System.Data.SqlClient.SqlInternalConnection.GetTransactionCookie(Transaction transaction, Byte[] whereAbouts)

   at System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx)

   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 System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

Solution

To solve the problem the machine which tries to communicate with database which is hosted at another machine has to be trusted for delegation. Enable the machine which shows the error to be trusted for delegation. Note that DTC service user has to be in this case NETWORKSERVICE user.


Posted Oct 29 2009, 01:13 PM by Damir Dobric

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
daenet GmbH