The Daily Parker

Politics, Weather, Photography, and the Dog

EF6 "The default RetryManager has not been set" problem

Aw, buggre alle this for a Larke.

I'm all in favor of upgrades, but for Foucault's sake, don't break things. I'm trying to upgrade a .NET project to Entity Framework 6, and I want to smack the developers.

Under previous versions, you could set the retry manager through configuration. This was really helpful for unit testing, when you might want to change the configuration and have the application block load a transient fault handler automatically.

With Entity Framework 6 (EF6 — yes, this is blatant SEO), you have to set up the default transient fault handler in code:

public void TestFixtureSetup()
	var strategy = new FixedInterval("fixed", 10, TimeSpan.FromSeconds(3));
	var strategies = new List { strategy };
	var manager = new RetryManager(strategies, "fixed");

I mean, really? With EF6, you've got to put this code in every unit test sequence in your solution. Basically, that means you need to put it in every unit test file. Before, it had its own defaults.

Despite being all in favor of upgrades, I do get impatient when (a) the upgrade breaks existing code and (b) the entity performing the upgrade is one of the wealthiest entities in the history of business.

All right, then. Bring on the copy pasta...

Comments are closed