确定 SQL Server 2000 中的锁影响的资源
我添加了一个简单的 Web 界面来显示来自商业现成 (COTS) 应用程序的数据。此 COTS 会锁定用户正在主动查看的任何记录(无论他们是否打算编辑和更新它)。
我找到了 sp_lock 和 Microsoft sp_lock2 脚本,并且可以看到锁,所以这一切都很好。
但是,我不知道如何判断我要更新的特定记录是否受到这些锁之一的影响。如果我提交更新请求并且实际上存在锁定,则 Web 界面将无限期地等待,直到用户关闭 COTS 中的窗口。
我如何才能:
a) 在发出更新之前确定记录已被锁定
,或者
b) 发出将立即返回锁定状态的更新,而不是无限期地等待 COTS 用户关闭该记录的窗口?
I am adding a simple web-interface to show data from a commercial off the shelf (COTS) application. This COTS issues locks on any record the user is actively looking at (whether they intend to edit and update it or not).
I have found sp_lock and the Microsoft sp_lock2 scripts and can see the locks, so that's all well and good.
However, I cannot figure out how I can tell if a specific record I am about to update has been affected by one of these locks. If I submit the update request and there is in fact a lock, the web-interface will wait indefinitely until the user closes the window in the COTS.
How can I either:
a) determine before issuing an update that the record has been locked
OR
b) issue an update that will immediately return with a LOCKED status rather than indefinitely waiting on the COTS user to close their window on that record?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论