c# - Why is TransactionScope causing problems using Entity Framework? -


I have a problem relating to the scope, I know that some local transaction, probably MSDTC (I do not know too much Is about it)

Other project developer (similar codebase, committed everything) implements the whole solution, but when I try to get some data from the database (always), I have the following error:.

  The underlying provider failed on EnlistTransaction. System.Data.Objects on System.Data.Objects.ObjectQuery`1.GetResults on System.Data.EntityClient.EntityConnection.EnlistTransaction (Transaction transaction) (System.Data.Objects.ObjectContext.EnsureConnection) (Nullable` 1 forMergeOption) .ObjectQuery`1.System.Collections.Generic.IEnumerable & LT; T & gt; .GetEnumerator () System.Linq.Enumerable.First [TSource] & LT on System.Data.Objects.ELinq.ObjectQueryProvider on (IEnumerable`1 source); GetElementFunction & gt; b__0 [TResult] System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle [TResult] on System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq (IEnumerable`1 query expression queryRoot) to (IEnumerable`1 sequence). IQueryProvider.Execute [S] (expression) System.Linq.Queryable.First [TSource] on (IQueryable `1 source, expression 1) predicate)  

If I comment on using transaction liability , Full () and everything, it works as expected.

Do you ever have this problem before?

Edit: / P>

query that this error throws like something much simpler,:

  var entity = Entities.EntityX.First (p = & Gt; PIID == ID);  

Edit, solve:

The server's LMHost was outdated.

Can firewall rules prevent DTC ports? Or an incomplete firewall rule allows some DTC ports, but not others? I have never received distributed transactions to work well through the firewall. even after that.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -