调用存储过程的时候.NET READPAST锁定错误 [英] .NET READPAST lock error when calling a stored procedure

查看:532
本文介绍了调用存储过程的时候.NET READPAST锁定错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的。NET code有一个输出paramater调用存储过程

I'm trying to call a stored procedure from my .NET code which has one output paramater.

其使用的SqlCommand,SqlParameter的等所有标准ADO.NET的东西。但我发现了,即使我的事务级别的提交读下面的错误。

Its all standard ADO.NET stuff using SqlCommand, SqlParameter and so on. But I'm getting the error below even though my transaction level is READ COMMITTED.

您只能指定犯下的读或重复读隔离级别的READPAST锁。 提交的事务是在批处理结束检测。该事务回滚。 描述:在当前Web请求的执行过程中发生未处理的异常。请检查堆栈跟踪有关该错误以及详细信息

You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels. Uncommittable transaction is detected at the end of the batch. The transaction is rolled back. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where

推荐答案

您指定NOLOCK与READPAST提示?如果是这样,它的行不通。

Are you specifying NOLOCK with the READPAST hint? If so, its not going to work.

为什么要使用READPAST摆在首位(或NOLOCK如果你正在使用它)?

Why are you using READPAST in the first place (or NOLOCK if you are using it)?

这篇关于调用存储过程的时候.NET READPAST锁定错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆