private void ReallyClose()
        {
            NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "ReallyClose");
            _postponingClose = false;

            // clear the way for another promotable transaction
            promotable = null;

            connector.Notification -= NotificationDelegate;
            connector.Notice       -= NoticeDelegate;

            if (SyncNotification)
            {
                connector.RemoveNotificationThread();
            }

            if (Pooling)
            {
                NpgsqlConnectorPool.ConnectorPoolMgr.ReleaseConnector(this, connector);
            }
            else
            {
                if (Connector.Transaction != null)
                {
                    Connector.Transaction.Cancel();
                }

                Connector.Close();
            }

            connector = null;

            this.OnStateChange(new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed));
        }
        private void Init()
        {
            NoticeDelegate       = new NoticeEventHandler(OnNotice);
            NotificationDelegate = new NotificationEventHandler(OnNotification);

            promotable = new NpgsqlPromotableSinglePhaseNotification(this);
        }