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 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?
Yes, the SPID will be the same for the duration of the transaction.
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.