事务锁定插入语句
我有一个外部分布式事务,它将一条插入语句锁定(挂起)到表中。 我无法控制外部交易。如何在非常细粒度的级别上避免这种阻塞。我尝试将事务抑制置于 .net 级别的插入周围。它不起作用。
请查看图片以获取详细信息。
此类问题的任何解决方案都可能非常有帮助。我感谢您的支持。
I have an outer distributed transaction which is locking (Hanging) an insert statement to a table.
I don't have control over the outer transaction. How to avoid this blocking at the very granular level. I tried to put Transaction Suppress around that insert at .net level. It didn't work.
Please look at the image for detailed information.
Any solution to this kind of issue could be very helpful. I appreciate your support.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果两个操作所关注的内容之间存在很强的交叉,并且不在同一事务中,那么这种情况是可以预料到的。外部事务可能采用了导致块的键范围锁(猜测外部事务是“可序列化”隔离级别)。这里你实际上无能为力,除了:
如果你不能做任何这些事情,那么你不能 插入时不破坏完整性 - 所以它不会让你这样做。您可能需要考虑推迟插入,直到外部操作完成。
That is expected if there is a strong crossover between what the two operations are looking at, and aren't in the same transaction. The outer transaction has presumably taken a key-range lock that is causing the block (at a guess the outer transaction is "serializable" isolation-level). There is nothing you can really do here, except:
if you can't do any of those things, then you can't insert without breaking integrity - so it won't let you. You might want to consider deferring the insert until the outer operation has comlpleted.