如何处理多个客户端 WInforms 上的数据库更新源 [英] How to handle feeds of Database Updates on Multiple Client WInforms

查看:37
本文介绍了如何处理多个客户端 WInforms 上的数据库更新源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在用 C# 在 Winforms 上开发桌面应用程序,使用单个后端系统或数据库作为 Postgresql.桌面应用程序将由本地 LAN 或 WAN 上的多个用户使用,我的数据库服务器将放置在 WAN 上.

We are developing an Desktop Applications on Winforms in C# with a single backend system or Database as Postgresql. The Desktop Applications will be used by multiple users on a Local Lan or on a WAN where my Database server will be placed on a WAN.

用户将对数据库表执行更新、插入、删除操作.我需要的是,当任何用户执行上述三个操作中的任何一个时,其他已登录或将在一段时间后登录的用户自动在 winforms 中查看其他用户执行的活动.请帮助我如何进行相同的操作.

The users are going to perform update, insert, delete on the Database tables. What i need is when any user performs any of the above three operations, automatically other users who are logged in or will log in after some times, gets to see in a winforms about the activities performed by the other user. Please help me on how should i proceed with the same.

问候更多

推荐答案

您要找的是消息队列服务.

工作流程如下:

  1. 自定义服务将使用 postgresql LISTEN 来收集"来自 PostgreSQL 的通知并作为消息提供给 MQS
  2. 例如,在 PostgreSQL 中,您可以使用 pgsql NOTIFY 从触发器内部通知自定义服务.
  3. 应用程序将从 MQS 读取消息并在 UI 上呈现给用户.
  1. custom service will use postgresql LISTEN to "collect" notifications from PostgreSQL and feed as messages into MQS
  2. Inside PostgreSQL you can use pgsql NOTIFY to notify custom services from within trigger for example.
  3. Application would be reading messages from MQS and presents to the users on UI.

问候高

这篇关于如何处理多个客户端 WInforms 上的数据库更新源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆