Beispiel #1
0
        public static void Close(IPhysicalConnection conn)
        {
            IAsyncResult res = conn.BeginClose(null);

            Async.WaitFor(res);
            conn.EndClose(res);
        }
Beispiel #2
0
 private void Connected(IAsyncResult async)
 {
     try
     {
         m_connecting = false;
         m_conn.EndOpen(async);
         UsageStats.Usage("dbconnect",
                          "dialect", m_conn.Dialect != null ? m_conn.Dialect.DialectName : "",
                          "dbversion", m_conn.SystemConnection != null ? m_conn.SystemConnection.ServerVersion : "",
                          "type", m_conn.SystemConnection != null ? m_conn.SystemConnection.GetType().FullName : m_conn.GetType().FullName);
         //Properties["connected"] = "1";
         DispatchChangedProperties();
         CallRefresh();
         OnConnect();
     }
     catch (Exception e)
     {
         Errors.Report(e);
         m_conn.BeginClose(Async.CreateInvokeCallback(RealNode.Invoker, (AsyncCallback)Disconnected));
         CallRefresh();
     }
     ProcessRegister.RemoveBackgroundTask("s_connect");
 }