locked
DbContext and System.Data.SqlClient.SqlException's RRS feed

  • Question

  • I've noticed that if I use an invalid server name in my connection string and use this for a DbContext, it takes several seconds before a SqlException is thrown; even though both my app and my DB are on the same box.

    Intellitrace events show that the exception is thrown/caught multiple times (before it reaches my error handler). Is this because EF retries the connection several times ?

    Is there a way I can control these retries/ shorten the time spent before DbContext gives up trying to connect?

     

    Saturday, July 30, 2011 11:16 AM

Answers