.net – TransactionScope v SQLTransaction

I found the following quote: “It is recommended that you use the TransactionScope class to create implicit transactions on this website”: http://msdn.microsoft.com/en-us/library/system Does .transactions.transactionscope.aspx.TransacrtionScope replace the SQLTransaction class? That is, should all new applications/transaction functions use the TransactionScope class? If this is the case, then I assume that SQLTransaction is there so that the legacy application does not need to be changed?

I have read many webpages, it is recommended that if you use multiple connections, you should use TransactionScope, but if you have a unit that performs multiple operations, the connection should be treated as an atomic unit of work, then it should Do you use TransactionScope?

I personally like transactionScope, because your query to the database does not require sqlTransaction (or connection) or other The parameters of the relevant code to maintain the transaction. This usually allows your service/business layer to fully manage the transaction, which is just cleaner for me.

I found the following quote: “I suggest you Use the TransactionScope class to create implicit transactions on this website”: http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx.TransacrtionScope Has the SQLTransaction class replaced? That is, should all new applications/transaction functions use the TransactionScope class? If this is the case, then I assume that SQLTransaction is there so that the legacy application does not need to be changed?

I have read many webpages, it is recommended that if you use multiple connections, you should use TransactionScope, but if you have a unit that performs multiple operations, the connection should be treated as an atomic unit of work, then it should Do you use TransactionScope?

I personally like transactionScope, because your query to the database does not require sqlTransaction (or connection) or other related code parameters to maintain the transaction. This usually allows you The service/business layer completely manages the affairs, which is just cleaner for me.

Leave a Comment

Your email address will not be published.