title: NHibernate or FluentNHibernate doesn't seem to handle NpgsqlException
body: <p>I try to connect to both PostgreSQL and SQL Server databases with NHibernate with Fluent. I tried to connect to an unexisting database to handle this user possibility. When I run the test, I receive a message like "NpgsqlException does not handle by the user code" when I use PostgreSQL When I try with SQL Server, SqlException is handle properly. Here is the connection code in my application for PostgreSQL</p>
  
  <pre><code>              try{
                          this.sessionFactory = Fluently.Configure()
                          .Database(
                              PostgreSQLConfiguration.PostgreSQL82.ConnectionString(
                                      @"Server=" + this.iGreffeDesktop.Hostname +
                                      ";Port=" + this.iGreffeDesktop.Port +
                                      ";Database=" + this.iGreffeDesktop.Database +
                                      ";User ID=" + this.iGreffeDesktop.Username +
                                      ";Password=" + this.iGreffeDesktop.Password +
                                      ";")
                          .Mappings(
                              m =&gt; m.FluentMappings
                                  .AddFromAssemblyOf&lt;Comptes&gt;())
                          .BuildSessionFactory();
               }
               catch (Exception e)
               {
                    this.error = "Connection error!!!";
               }
  </code></pre>
  
  <p>and for SQL Server</p>
  
  <pre><code>             try{
                     this.sessionFactory = Fluently.Configure()
                          .Database(
                          MsSqlConfiguration.MsSql2005
                                  .ConnectionString(
                                      @"Server=" + this.iGreffeDesktop.Hostname +
                                      ";initial catalog=" + this.iGreffeDesktop.Database +
                                      ";user=" + this.iGreffeDesktop.Username +
                                      ";password=" + this.iGreffeDesktop.Password +
                                      ";")
                                  .ShowSql()
  
                          .Mappings(
                              m =&gt;
                                  m.FluentMappings
                                      .AddFromAssemblyOf&lt;Comptes&gt;()
                          )
                          .BuildSessionFactory();
               }
               catch (Exception e)
               {
                    this.error = "Connection error!!!";
               }
  </code></pre>
  
  <p>I use NHibernate 2.1.2.4 build on Net 3.5. I tried to handle NpgsqlException but the error messages still appear. Is something missing in my code or it's a NHibernate bug?</p>
  
  <p><strong>EDIT:</strong> It seems to be a sporadict problem. Basically. I wrote a connection form with Visual Studio C# who is run Inside AutoCAD environment. The user enters the connection informations inside the form and my script try to connect to the database. The aim of the above code is to try to connect to a database and if not, returns an error message to the user.</p>
  
  <p>I tried the above code by replacing the "Comptes" class by "ComptesMap" class who is the NHibernate Comptes mapping class to see what is happened. I found that the first time I run the script inside AutoCAD, the script connects to any databases, even one who doesn't exist!!! After closing AutoCAD and reopenning it, I run the script again and then, I get NpgsqlException on any PostgreSQL databases, even the one who exists!!!</p>
  
  <p>I'm really trouble. It suggests an environment problem. I'm newbie to use NHibernate. I try to connect with code I found on the Web. I don't understand what is wrong to my code.</p>