【发布时间】:2009-06-09 16:15:22
【问题描述】:
我在 linq2sql 中做一些需要在事务中运行的操作。但是,我在事务内部使用的一些方法也使用 linq2sql 并在它们自己的事务内部运行(内部事务在存储过程中运行)。这给了我一个例外
[TransactionInDoubtException: The transaction is in doubt.]
System.Transactions.TransactionStateInDoubt.EndCommit(InternalTransaction tx) +76
with the inner exception
[SqlException (0x80131904): There is already an open DataReader associated with this Command which must be closed first.]
如果我对 SQL Server 使用 MultipleActiveResultSets,我会得到异常
[SqlException (0x80131904): The transaction operation cannot be performed because there are pending requests working on this transaction.]
有没有人以这种方式使用 linq2sql 和 transactionscope 的经验?
【问题讨论】:
标签: c# linq-to-sql transactions