SQL Azure Context Getting Forcibly Closed

2 posts, 0 answers
  1. Brent
    Brent avatar
    33 posts
    Member since:
    Jun 2010

    Posted 12 Feb 2012 Link to this post

         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.  
    1. 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?
    2. 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.
    3. Any other suggestions for how to solve for this issue when using Azure?


    Brent 
       
  2. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 13 Feb 2012 Link to this post

    Hello Brent,
    it is the best to use the ado connection pool instead of the OpenAccess pool.

    Please have a look here to setup the backend configuration.

    All the best,
    Jan Blessenohl
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
Back to Top