sql - How to finish connection C# Postgres when I lose the network connection with the server -


I'm having some problems verifying when the user is connected to the database, because when the customer lost the network connection If the resumption is opened in the database, then I want to complete those connections when the client unexpectedly lost the connection or another way to verify the connection opened. I am using the query below;

Select * from pg_stat_activity;

Use a little so that the customer quickly gets notice when the customer Connection loses. / P>

There is actually no other way to do this unless you know in some way through a sideband that the client connection has been lost - in which case you noted, you can call it Pg_stat_activity and pg_terminate_backend (pid) .


Comments