I currently have made a UnitOfWork implementation which wraps both the database connection and the transaction.
using (var uow = UnitOfWorkFactory.Create())
{
// do db operations here through repositories
uow.SaveChanges();
}
Rollback will be called if SaveChanges
haven't been called before the uow gets disposed.
Is it a bad design choice to let the uow handle both the connection and the transaction?
Let's say that I got a ASP.Net MVC website where most of the actions are just fetching information from the database. Are there a performance penalty for creating/committing transactions that aren't actually not doing anything in the database?