Consider the following code which does not rollback the transaction if an exception is caught.
transaction = connection.BeginTransaction();
command.Transaction = transaction;
try {
// interact with database here
catch {}
finally {
connection.Close();
}
What are the consequences of this and is it necessary to rollback the transaction?
It will leave an open transaction on the database, which could potential block other queries.
Taken from here: