If you have a database transaction that should be read only, do you commit or rollback? Is there any reason to do one or the other? Does one of the approachs improve database performance?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Some RDMS (at least Oracle ) have READ ONLY isolation level. Otherwise, I prefer
ROLLBACKsince it doesn’t create an entry in transaction log (a bit better from performance point of view).Update
Some explanations.
Most RDMS log all committed transactions and changes associated with transaction. Even if no changes are made, server logs a transaction. I don’t see any points in wasting server resources by storing useless data.