none
Persistence of temp tables and CONTEXT_INFO across transient faults RRS feed

  • Question

  • I have a couple questions about what happens when an app is using a ReliableSqlConnection to connect to SQL Database, and it encounters a transient fault in the midst of a series of individual commands.

    If this transient fault implies the loss of the connection due to failover or such, and ReliableSqlConnection helpfully reconnects and retries the failed command...

    1) What would happen to any temp tables that would otherwise have been in scope, having been created in a previous command?

    2) Is the CONTEXT_INFO value provided by WASD guaranteed to be the same from Open() to Close() on the ReliableSqlConnection, or does it get reset if a reconnect occurs, or for that matter, in any other scenario?

    Extending that question a little further - though this has nothing to do with transient faults - is the value stored in CONTEXT_INFO unique to a connection, in that it doesn't show up with the same value the next time that connection is reused from the pool, or in any other instance?

    Wednesday, March 12, 2014 4:44 PM

All replies

  • Hi,

    To answer your both questions:

    1. Any temp tables are lost when you loose the connection, since they are tied to the session.  Now, you can have shared temp tables (created with ##NAME).  In this case, they are lost only when the last session is closed;

    2. In this case, the CONTEXT_INFO gets reset.

    When a connection is reused from the pool, it gets reset and as a result, the CONTEXT_INFO is reset too.

    Thanks


    Lfsantos

    Wednesday, May 21, 2014 10:42 PM