As learning exercise and before trying to use any ORM (like EF) I want to build a personal project using ADO.NET and stored procedures.
Because I don\'t want my code
It all depends on the transaction isolation level. Using the default isolation level (ie. read committed) then your SELECT
should occur no performance penalty if is wrapped in a transaction. SQL Server internally wraps statements in a transaction anyway if one is not already started, so your code should behave almost identical.
However, I must ask you why not use the built-in .Net TransactionScope? This way your code will interact much better with other libraries and frameworks, since TransactionScope
is universally used. If you do decide to switch to this I must warn you that, by default, TransactionScope
uses SERIALIZABLE isolation level and this does result in performance penalties, see using new TransactionScope() Considered Harmful.