C# 的持久 SQL 表锁
我正在尝试在表级别创建持久 SQL (SQL Server 2005) 锁。我没有更新/查询指定的表,但我需要阻止第三方应用程序更新锁定的表,以此作为防止发布事务的方法(我希望锁定的表是其事务上干扰的关键)我的处理)。
根据我的经验,该表仅在特定事务发生时被锁定。有什么想法吗?
3rd 方开发人员已将此功能记录为增强功能,但由于他们正在推出主要版本,因此我预计至少要等待 6 个月。我知道这不是一个很好的解决方案,因为他们的软件会崩溃,但它的性质足够重要,我们愿意承担后果。
I'm trying to create a persistent SQL (SQL Server 2005) lock on a table level. I'm not updating/querying the specified table, but I need to prevent a third party application from updating the locked table as a means to prevent transactions from being posted (the table I wish to lock is the key on their transaction that interferes with my processing).
From my experience the table is only locked for the time a specific transaction is taking place. Any ideas?
The 3rd party developer has logged this feature as an enhancement, but since they are in the middle of rolling out a major release I can expect to wait at least 6 months for this. I know that this isn't a great solution, since their software will fall over but it is of a critical enough nature that we're willing to live with the consequences.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将表移动到不同的文件组,然后将该文件组更改为只读。该表实际上是只读的:
Move the table to a different file group, then alter the file group to read-only. The table will be in effect read-only:
重命名该表,当第 3 方准备就绪时,将其重命名回应有的名称
rename the table and when the 3rd party is ready rename it back to what it should be