private static void ExecuteBlind(NpgsqlConnector connector, NpgsqlQuery query, int timeout) { // Block the notification thread before writing anything to the wire. using (var blocker = connector.BlockNotificationThread()) { // Set statement timeout as needed. connector.SetBackendCommandTimeout(timeout); // Write the Query message to the wire. connector.Query(query); // Flush, and wait for and discard all responses. connector.ProcessAndDiscardBackendResponses(); } }
internal static void ExecuteBlind(NpgsqlConnector connector, NpgsqlQuery query) { // Block the notification thread before writing anything to the wire. using (var blocker = connector.BlockNotificationThread()) { // Set statement timeout as needed. connector.SetBackendCommandTimeout(20); // Write the Query message to the wire. connector.Query(query); // Flush, and wait for and discard all responses. connector.ProcessAndDiscardBackendResponses(); } }