用于在表更改上触发代码的 SQL 通知的替代方案

发布于 2024-10-06 00:42:43 字数 470 浏览 7 评论 0原文

因此,我刚刚继承了一个应用程序,该应用程序使用与 SQL 通知服务关联的 SQL 依赖关系函数,以便在数据库中的一个表发生更改时执行某些功能。具体来说,我有一个 MVC 网站 - 在 global.asax 文件中,有一个监听函数,每当表发生更改时,该函数都会根据数据更改更新路由约束。

不幸的是,我们也迁移到了 SQL Server 2008。现在,我根本无法使用此功能。据我所知,它实际上已在 SQL Server 2008 中被删除,尽管令人烦恼的是,它有时似乎在出错时会触发。这让我有点困惑,但似乎该服务不再可用。

所以我需要一个建议的替代方案。我查看了 StreamInsight,但坦率地说,它似乎是一把大锤来破解坚果。另外,我非常怀疑对它的支持可能会被删除,就像对通知服务的支持一样。最简单的方法就是安排一个控制台应用程序每 5 分钟左右完成一次工作,但立即更新会更好,而且我不确定让命令行应用程序更新某些内容有多容易作为路由的网站基础。

那么 - 有什么建议吗?

So I've just inherited an application which used the SQL Dependency function associated with SQL Notification Services in order to perform some functionality whenever one of the tables in the DB was changed. Specifically I have an MVC website - in the global.asax file there was a listening function which updated the route constraints whenever a table was changed, based on the data changes.

Unfortunately we've also migrated to SQL Server 2008. Now, I can't get this functionality to work at all. As far as I can make out it has actually been removed in SQL Server 2008 although, annoyingly, it does sometimes seem to fire when it errors. Which confused me for a bit, but it would seem that the service is no longer available.

So I'm in need of a suggested alternative. I took a look at StreamInsight but it seems like a sledgehammer to crack a nut, frankly. Plus I'm more than a little suspicious that support for it might be removed going forward, just like support for Notification Services was. The simplest approach is simply to schedule a console application to do the work every 5 minutes or so, but immediate updates would be hugely preferable, and I'm not sure how easy it would be to get a command-line application to update something as fundamental on a website as the routing.

So - any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

我的痛♀有谁懂 2024-10-13 00:42:43

来自 此线程的 MS 帖子,SQL Server 2005 SP 3 通知服务将与 SQL Server 2008 一起运行。我不确定您是否要这样做,但据说只要支持 SQL Server 2005,就会支持这一点。

来自 SQL Server 2005 SP 3 通知服务的自述文件:

此版本的 SQL Server 2005 通知服务组件支持针对 SQL Server 2005 数据库引擎或 SQL Server 2008 数据库引擎实例运行 SQL Server 2005 通知服务。

您可以在此处下载说明:SQL 2005 SP 3 自述文件

From an MS post on this thread, SQL Server 2005 SP 3 notification services will run with SQL Server 2008. I'm not sure if you want to do this, but supposedly this will be supported as long as SQL Server 2005 is supported.

From the readme for SQL Server 2005 SP 3 notification services:

This release of the SQL Server 2005 Notification Services components provides support for running SQL Server 2005 Notification Services against either an instance of the SQL Server 2005 Database Engine or SQL Server 2008 Database Engine.

You can download the notes here: SQL 2005 SP 3 ReadMe files

零度℉ 2024-10-13 00:42:43

我认为您可以考虑使用一些 JMS 提供程序的发布订阅机制。您的 asp .net 页面可以将消息发布到订阅者将选择的主题并进行必要的更新。

I think you can consider publish subscribe mechanism using some JMS provider. Your asp .net page can post the message to a topic which will be picked up by a subscriber and do the necessary updates..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文