I upgraded my EF to EF 6.0.2 in my code. I have the following line of code:
applicationDbContext.Database .ExecuteSqlCommand(@"ALTER DATABASE CURRENT SET RECOVERY FULL;");
After the update, the following error message appears:
The ALTER DATABASE attribute is not allowed in multiple transaction statements.
I fixed the problem with TranscendalBehavior, like the code below:
applicationDbContext.Database.ExecuteSqlCommand( TransactionalBehavior.DoNotEnsureTransaction, @"ALTER DATABASE CURRENT SET RECOVERY FULL;");
My question is:
- Why am I getting this error with EF 6?
- Is my fix a valid fix for the problem or the devil lurking behind this solution?
- Is there any other approach to solving the problem?
Any help would be greatly appreciated !?
entity-framework
Bassam Alugili Feb 11 '14 at 10:21 2014-02-11 10:21
source share