1

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?

user275157
  • 1,332
  • 4
  • 23
  • 45

2 Answers2

2

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.

Community
  • 1
  • 1
astaykov
  • 30,768
  • 3
  • 70
  • 86
1

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.

Community
  • 1
  • 1
sharptooth
  • 167,383
  • 100
  • 513
  • 979
  • So these are just random glitches that would go away if I retry as mentioned in the document. Will put in the retry code as well. – user275157 Jul 24 '12 at 17:53