开发者

SQL Server SPID and transaction scope

We are running several calls against a SQL Server database within a transaction 开发者_如何转开发scope using entity framework.

Are we right is assuming that the SPID will be held for the duration of the transaction and that all calls will be made on the same SPID?


We found out that a SPID is connected to a connection, not to a transaction.

But EF will close and open a connection in order to enlist it in a transaction.

The connection is not actually closed in is released to the connection pool and then retrieved again.

The problem is then that you may not get the same connection back from the connection pool, in which case you will not have the same SPID.


Yes, the SPID will be the same for the duration of the transaction.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜