Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Issue: EF 6 and SQL Azure Federations [978]

$
0
0
Hi,

I'm currently working on a new project with EF6 (ntityFramework 6.0.0-alpha3) and I encounter a problem with the SQL Azure federations...

According to [this article (2013-01-07)](http://msdn.microsoft.com/en-us/library/windowsazure/hh703245.aspx), I send the USE statement and I open a new transaction:

```
using (TestEntities dc = new TestEntities())
{
((IObjectContextAdapter)dc).ObjectContext.Connection.Open();
dc.Database.ExecuteSqlCommand(@"USE FEDERATION TestFederation (FederationKey=0) WITH FILTERING = OFF, RESET"); // Exception occurs here

using (TransactionScope scope = new TransactionScope(TransactionScopeOption.RequiresNew))
{
[.......]
scope.Complete();
}
}
```

With Entity Framework 5 installed, the "USE FEDERATION..." is accepted but with Entity Framework 6 (same code, juste a different version of EF), an exception occurs: "USE FEDERATION statement not allowed within multi-statement transaction."

Anyone has a idea why it does not work?

Thanks in advance!

Viewing all articles
Browse latest Browse all 10318

Trending Articles