In .NET, when we use TransactionScope we can share a same transaction across multiple connections.
using(TransactionScope tran = new TransactionScope()) {
//this method open a new connection
CallAMethodThatDoesSomeWork();
//this method open another new connection
CallAMethodThatDoesSomeMoreWork();
tran.Complete();
}
I can't understand how it is possible, taking account that a transaction need a specific connection to run in the database.
How is it working? I think that maybe the physical connection is always the same. Could be this possible?
Update: suppose that the connection string is the same for all connections, i.e. I don't work with different databases, is always the same...