SQLID SPID and Transaction Scope

We are making multiple calls to SQL Server databases within a transaction using the entity framework.

Are we correct in assuming that the SPID will be held for the duration of the transaction and that all calls will be made with the same SPID?

+2


a source to share


2 answers


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

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



The connection is not actually closed, released to the connection pool and then loaded again.

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

0


a source


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



0


a source







All Articles