SQL transactions is used for insert, update, but should it be used for reading records?
If you need the most up to date to the millisecond information you can use a transaction that is constructed with a TransactionOptions
having an IsolationLevel of Serializable
.
This would effect performance as it will lock the table (or parts of the table), so you need to figure out if you really need this.
For most uses, if you are doing a read, you do not need to wrap a transaction around it (assuming you are only doing reads in the one operation).
It really depends on your application, what data it requires and how it uses it.
For example, if you do a read and depending on the results you do a write or update, but it is critical that the data you just read is current, you should probably wrap the whole logic into a single transaction.