title: NHibernate : recover session after connection lost
body: <p>I'm using NHibernate with SQL Server 2005 in a WPF client application.</p>
  
  <p>If I manually stop the SQL Server service and then restart it the session doesn't automatically reconnect. </p>
  
  <p>So far I'm doing this witch seems to work :</p>
  
  <pre><code>try
  {
      using (ITransaction transaction = this.Session.BeginTransaction())
      {
          // some select here
      }
  }catch(Exception ex)
  {                
      if(this.Session.Connection.State == ConnectionState.Closed)
      {
          try
          {
              this.Session.Connection.Open();
          }
          catch (Exception)
          {
          }
      }
  }
  </code></pre>
  
  <p>Is there a better way ?</p>