What causes the PgSqlConnection.ConnectionLost event to fire?

What causes the PgSqlConnection.ConnectionLost event to fire?

Postby branrigg » Mon 31 Aug 2015 23:12

Specifically, I'm wondering if a failure/exception when calling PgSqlConnection.Open() will cause the PgSqlConnection.ConnectionLost event to fire. And if it does, what would be the ConnectionLostCause? (Like ConnectionLostCause.Connect or .Execute, etc).

Thanks very much for your time and help!
branrigg
 
Posts: 6
Joined: Mon 31 Aug 2015 23:07

Re: What causes the PgSqlConnection.ConnectionLost event to fire?

Postby Pinturiccio » Tue 01 Sep 2015 12:27

The ConnectionLost event fires when the connection is lost. The connection must be open for this, and that's why this event never fires when opening the connection.
Pinturiccio
Devart Team
 
Posts: 2020
Joined: Wed 02 Nov 2011 09:44

Re: What causes the PgSqlConnection.ConnectionLost event to fire?

Postby branrigg » Tue 01 Sep 2015 21:29

Ok, thanks.

What events do fire when PgSqlConnection.Open() fails (like with a "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host." message)?
branrigg
 
Posts: 6
Joined: Mon 31 Aug 2015 23:07

Re: What causes the PgSqlConnection.ConnectionLost event to fire?

Postby Pinturiccio » Wed 02 Sep 2015 15:37

The Error event fires when an error occurs while opening a connection. For more information, please refer to https://www.devart.com/dotconnect/postgresql/docs/?Devart.Data.PostgreSql~Devart.Data.PostgreSql.PgSqlConnection~Error_EV.html
Pinturiccio
Devart Team
 
Posts: 2020
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for PostgreSQL