Entity Framework Migrations: Timeout SqlException during migrating
Asked Answered
O

1

6

Sql Server is accessible. I want to migrate database using Entity Framework migrations. There i have "Images" table with 130k records having images. In migration there "INDEX" added to these table using "CREATE INDEX". I get SqlException that command timeout is expired. But in connection string i can define only Connect Timeout. I tried define Command Timeout here: (IObjectContextAdapter)DbContext.ObjectContext.CommandTimeout but it didn't help me. And in DbMigrator too, but he hasn't such property anywhere.

So i need help, I should define CommandTimeout for migration in Entity Framework, but don't know how to do this. Help me plz, sorry for bad English

Outshout answered 20/5, 2012 at 8:13 Comment(0)
G
4

I don't think this is possible in EF4. It was added as a feature to the release candidate of EF5 which was released this week: http://blogs.msdn.com/b/adonet/archive/2012/05/15/ef5-release-candidate-available-on-nuget.aspx

Grubstake answered 20/5, 2012 at 9:4 Comment(2)
Thank you! I downloaded EF5 and successfully set CommandTimeout property. Migration finished throw few minutesOutshout
The link is broken.Willner

© 2022 - 2024 — McMap. All rights reserved.