internal void ReallyClose() { Log.Trace("Really closing connection", Connector.Id); _postponingClose = false; #if !DNXCORE50 // clear the way for another promotable transaction _promotable = null; #endif Connector.Notification -= NotificationDelegate; Connector.Notice -= NoticeDelegate; if (Pooling) { NpgsqlConnectorPool.ConnectorPoolMgr.ReleaseConnector(this, Connector); } else { Connector.Close(); Connector.ProvideClientCertificatesCallback = null; Connector.UserCertificateValidationCallback = null; } Connector = null; OnStateChange(new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed)); }
void ReallyClose() { Log.Trace("Really closing connection", Connector.Id); _postponingClose = false; // clear the way for another promotable transaction _promotable = null; Connector.Notification -= NotificationDelegate; Connector.Notice -= NoticeDelegate; /*if (SyncNotification) * { * * }*/ if (Pooling) { NpgsqlConnectorPool.ConnectorPoolMgr.ReleaseConnector(this, Connector); } else { Connector.Close(); Connector.ProvideClientCertificatesCallback -= ProvideClientCertificatesCallbackDelegate; Connector.ValidateRemoteCertificateCallback -= ValidateRemoteCertificateCallbackDelegate; } Connector = null; OnStateChange(new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed)); }
/// <summary> /// Initializes a new instance of the /// <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> class /// and sets the <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>. /// </summary> /// <param name="ConnectionString">The connection used to open the PostgreSQL database.</param> public NpgsqlConnection(String ConnectionString) { NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME, "NpgsqlConnection()"); NpgsqlConnectionStringBuilder builder = cache[ConnectionString]; if (builder == null) { settings = new NpgsqlConnectionStringBuilder(ConnectionString); } else { settings = builder.Clone(); } LogConnectionString(); NoticeDelegate = new NoticeEventHandler(OnNotice); NotificationDelegate = new NotificationEventHandler(OnNotification); ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback); // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info. RSACryptoServiceProvider.UseMachineKeyStore = true; promotable = new NpgsqlPromotableSinglePhaseNotification(this); }
void Init() { NoticeDelegate = OnNotice; NotificationDelegate = OnNotification; #if !DNXCORE50 // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info. RSACryptoServiceProvider.UseMachineKeyStore = true; _promotable = new NpgsqlPromotableSinglePhaseNotification(this); #endif }
void Init() { NoticeDelegate = OnNotice; NotificationDelegate = OnNotification; ProvideClientCertificatesCallbackDelegate = DefaultProvideClientCertificatesCallback; ValidateRemoteCertificateCallbackDelegate = DefaultValidateRemoteCertificateCallback; // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info. RSACryptoServiceProvider.UseMachineKeyStore = true; _promotable = new NpgsqlPromotableSinglePhaseNotification(this); }
private void Init() { NoticeDelegate = new NoticeEventHandler(OnNotice); NotificationDelegate = new NotificationEventHandler(OnNotification); RemoteCertificateValidationCallback = DefaultRemoteCertificateValidationCallback; ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback); // CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback); // CertificateSelectionCallbackDelegate = new CertificateSelectionCallback(DefaultCertificateSelectionCallback); // PrivateKeySelectionCallbackDelegate = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback); // ValidateRemoteCertificateCallbackDelegate = new ValidateRemoteCertificateCallback(DefaultValidateRemoteCertificateCallback); // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info. RSACryptoServiceProvider.UseMachineKeyStore = true; promotable = new NpgsqlPromotableSinglePhaseNotification(this); }
/// <summary> /// Releases the connection to the database. If the connection is pooled, it will be /// made available for re-use. If it is non-pooled, the actual connection will be shutdown. /// </summary> public override void Close() { NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Close"); if (connector != null) { Promotable.Prepare(); // clear the way for another promotable transaction promotable = null; connector.Notification -= NotificationDelegate; connector.Notice -= NoticeDelegate; connector.StateChanged -= connector_StateChanged; if (SyncNotification) { connector.RemoveNotificationThread(); } if (Pooling) { NpgsqlConnectorPool.ConnectorPoolMgr.ReleaseConnector(this, connector); } else { Connector.ProvideClientCertificatesCallback -= ProvideClientCertificatesCallbackDelegate; Connector.CertificateSelectionCallback -= CertificateSelectionCallbackDelegate; Connector.CertificateValidationCallback -= CertificateValidationCallbackDelegate; Connector.PrivateKeySelectionCallback -= PrivateKeySelectionCallbackDelegate; if (Connector.Transaction != null) { Connector.Transaction.Cancel(); } Connector.Close(); } connector = null; this.OnStateChange(new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed)); } }
void ReallyClose() { _log.Trace("Really closing connection"); _postponingClose = false; // clear the way for another promotable transaction _promotable = null; Connector.Notification -= NotificationDelegate; Connector.Notice -= NoticeDelegate; if (SyncNotification) { // Disable async notifications for now //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; OnStateChange(new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed)); }
private NpgsqlConnection(NpgsqlConnectionStringBuilder builder) { this.settings = builder; LogConnectionString(); NoticeDelegate = new NoticeEventHandler(OnNotice); NotificationDelegate = new NotificationEventHandler(OnNotification); ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback); CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback); CertificateSelectionCallbackDelegate = new CertificateSelectionCallback(DefaultCertificateSelectionCallback); PrivateKeySelectionCallbackDelegate = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback); // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info. RSACryptoServiceProvider.UseMachineKeyStore = true; promotable = new NpgsqlPromotableSinglePhaseNotification(this); }
/// <summary> /// Initializes a new instance of the /// <see cref="Npgsql.NpgsqlConnection">NpgsqlConnection</see> class /// and sets the <see cref="Npgsql.NpgsqlConnection.ConnectionString">ConnectionString</see>. /// </summary> /// <param name="ConnectionString">The connection used to open the PostgreSQL database.</param> public NpgsqlConnection(String ConnectionString) { NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, CLASSNAME, "NpgsqlConnection()"); LoadConnectionStringBuilder(ConnectionString); NoticeDelegate = new NoticeEventHandler(OnNotice); NotificationDelegate = new NotificationEventHandler(OnNotification); ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback); CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback); CertificateSelectionCallbackDelegate = new CertificateSelectionCallback(DefaultCertificateSelectionCallback); PrivateKeySelectionCallbackDelegate = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback); ValidateRemoteCertificateCallbackDelegate = new ValidateRemoteCertificateCallback(DefaultValidateRemoteCertificateCallback); // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info. RSACryptoServiceProvider.UseMachineKeyStore = true; promotable = new NpgsqlPromotableSinglePhaseNotification(this); }
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; if (Connector.Transaction != null) { Connector.Transaction.Cancel(); } Connector.Close(); } connector = null; }
/// <summary> /// Releases the connection to the database. If the connection is pooled, it will be /// made available for re-use. If it is non-pooled, the actual connection will be shutdown. /// </summary> public override void Close() { NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "Close"); if (connector != null) { Promotable.Prepare(); // clear the way for another promotable transaction promotable = null; connector.Notification -= NotificationDelegate; connector.Notice -= NoticeDelegate; if (SyncNotification) { connector.RemoveNotificationThread(); } NpgsqlConnectorPool.ConnectorPoolMgr.ReleaseConnector(this, connector); connector = null; } }
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(); } NpgsqlConnectorPool.ConnectorPoolMgr.ReleaseConnector(this, connector); connector = null; }
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)); }
private void Init() { NoticeDelegate = new NoticeEventHandler(OnNotice); NotificationDelegate = new NotificationEventHandler(OnNotification); ProvideClientCertificatesCallbackDelegate = new ProvideClientCertificatesCallback(DefaultProvideClientCertificatesCallback); CertificateValidationCallbackDelegate = new CertificateValidationCallback(DefaultCertificateValidationCallback); CertificateSelectionCallbackDelegate = new CertificateSelectionCallback(DefaultCertificateSelectionCallback); PrivateKeySelectionCallbackDelegate = new PrivateKeySelectionCallback(DefaultPrivateKeySelectionCallback); ValidateRemoteCertificateCallbackDelegate = new ValidateRemoteCertificateCallback(DefaultValidateRemoteCertificateCallback); // Fix authentication problems. See https://bugzilla.novell.com/show_bug.cgi?id=MONO77559 and // http://pgfoundry.org/forum/message.php?msg_id=1002377 for more info. RSACryptoServiceProvider.UseMachineKeyStore = true; promotable = new NpgsqlPromotableSinglePhaseNotification(this); }
void ReallyClose() { _log.Trace("Really closing connection"); _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; OnStateChange(new StateChangeEventArgs(ConnectionState.Open, ConnectionState.Closed)); }