1
votes

I have a worker role that connects to Sql Azure retrieves a record at a time, processes it marks it done using Entity Framework 4. Pseudo code

 while (true)
 {
    ProcessRecord();
 }

 ProcessRecord()
 {
   try{
        ObjectContext oc = new ObjectContext ();
        //process records
        oc.Dispose()
    }
    catch(Exception e)
    {
        //logging code goes here...
     }
 }

The role runs just fine but occasionally (say 9 hrs once) I get an error - "The underlying provider failed on Open." Does that mean that the worker role is unable to connect to SQL Server?

2

2 Answers

2
votes

Do you log the exact error code? In general there are a lot of things that could be. As a start I suggest to read this article, explaining a lot of them. Also check out this SO question, as my answer there explains a lot about Windows Azure SQL Database.

1
votes

That's some random environment-related error as described here. That happens - SQL Azure is on a separate machine and sometimes network requests just fail. You have to retry your request, that's it.