查找用于停滞的sp_getapplock调用的resource_name

发布于 2025-02-09 14:05:19 字数 321 浏览 3 评论 0原文

我是使用SP_GETAPPLOCK存储过程调用来执行一些特定funcitonation的应用程序的DBA。有时,出于某些未知原因,也许是应用程序错误,gremlins或其他未知错误,锁不会释放。我可以通过查看应用程序DB来编程确定这些锁是否处于冷冻状态。我想在某些情况下调用sp_releaseaplock释放锁定,但是我无法弄清楚相应的sp_getapplock呼叫中使用的相关资源_name在系统DMV中存储的位置。

由于该应用程序每次称为随机资源名称,因此我无法将SP_Releaseleack调用进行编码。如何通过DMVS确定与sys.dm_tran_locks表中的条目关联的Resource_name?

I am the DBA for an application that uses the sp_getapplock stored procedure call to perform some specific funcitonality. Occasionally, for some unknown reason, perhaps application bug, gremlins, or other unknown error, the lock is not released. I can programmatically determine whether one of these locks is in a frozen state by looking in the application DB. I would like to call sp_releaseapplock to free the lock under certain circumstances, but I cannot figure out where the associated resource_name used in the corresponding sp_getapplock call is stored in the system DMVs.

Since the application uses a random resource name each time it is called, I cannot hardcode the sp_releaselock call. How do I determine through the DMVs the resource_name associated with an entry in the sys.dm_tran_locks table?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文