views:

345

answers:

1

I have a problem that I know is something local, related to transaction scope, probably MSDTC (I don't know very much about it).

The other project developer (same codebase, everything commited) executes the whole solution, but when I try to get some data from the database (not always), I have the following error:

The underlying provider failed on EnlistTransaction.


   at System.Data.EntityClient.EntityConnection.EnlistTransaction(Transaction transaction)
   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.First[TSource](IEnumerable`1 source)
   at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__0[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.Execute[S](Expression expression)
   at System.Linq.Queryable.First[TSource](IQueryable`1 source, Expression`1 predicate)

If I comment the using transaction scope, complete() and everything, it works as expected.

Have you ever had this problem before?

EDIT:

The query that throws this error is something very simple, like:

var entity = Entities.EntityX.First(p => p.ID == id);

EDIT, SOLVED:

Server's lmhosts was outdated.

+1  A: 

Firewall rules blocking the DTC ports, maybe? Or an incomplete firewall rule allowing some DTC ports, but not others? I've never gotten distributed transactions to work well through a firewall. Even after following the directions.

tvanfosson
I'm trying to run DTCPing.exe, but it throws an error in advpack.dll :S Only one result in google that says nothing about the error =/
Victor Rodrigues
The problem: server's lmhosts is outdated.
Victor Rodrigues