I have a WPF application where I have implemented a context Factory. The context factory keeps a class level variable holding an instance of the context. I have been recently testing against azure and have run into the fact the sql azure will forcibly close the connection if there has been no activity within 60 seconds which results in an exception being thrown (naturally) when I try to use the context again. I am looking at the best way to work through this.
- In the API documentation I see a section for ContextExceptionEventHandler but do not actually see this implemented when I browse through the class object model. My thought is I could catch the appropriate exception if the connection was forcibly closed and reopen. Can you give an example (In VB) how to use this?
- I have tried playing with the test when IDLE connection pool settings but they do not see to have an effect. This could be because I am not closing my connection for it to be put into an idle state within the pool.
- Any other suggestions for how to solve for this issue when using Azure?