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
{
Connector.ProvideClientCertificatesCallback -= ProvideClientCertificatesCallbackDelegate;
Connector.CertificateSelectionCallback -= CertificateSelectionCallbackDelegate;
Connector.CertificateValidationCallback -= CertificateValidationCallbackDelegate;
Connector.PrivateKeySelectionCallback -= PrivateKeySelectionCallbackDelegate;
Connector.ValidateRemoteCertificateCallback -= ValidateRemoteCertificateCallbackDelegate;
if (Connector.Transaction != null)
{
Connector.Transaction.Cancel();
}
Connector.Close();
}
connector = null;
this.OnStateChange (new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed));
}