title: Wrong Connection state in iAnywhere
body: <p>Very.. stupid problem.</p>
  
  <p>A call to SQLAnywhere12 is done from c# code.</p>
  
  <ul>
  <li>A database call to an available database is made and answered correctly. </li>
  <li>If the database is shut down (e.g. network) after it has initially worked, new connections just hang.</li>
  </ul>
  
  <p>The last things I can see on the callstack are:</p>
  
  <ul>
  <li>Intellitrace.OpenConnection</li>
  <li>SAConnection.Open</li>
  <li>SAConnectionPoolManager.AllocateConnection</li>
  <li>->Monitor.Enter</li>
  </ul>
  
  <p>Monitor.Enter just seems to wait forever.</p>
  
  <p>No Exception seems to be fired.</p>
  
  <p>So my idea was to look at the connection state and only trigger the command if connection is open (and even there with a very bad feeling about it - a connection can be broken directly after asking for the state)</p>
  
  <p>If i look at the connection object of the databae ( iAnywhere.Data.SQLAnywhere ) there is an available ConnectionState. This ConnectionState shows: "Open".</p>
  
  <p>If no connection to database is available, I would expect either "Broken" or "Closed".</p>
  
  <p>How can i tell SQLAnywhere to update the connection state?</p>
  
  <p>Or is there even a better possibility to get an excpetion?</p>