What is the difference between using
using (var scope = new TransactionScope(TransactionScopeOption.Required))
{
using (ISession session = NHibernateHelper.OpenSession())
{
using (ITransaction transaction = session.BeginTransaction())
{
session.Delete(entity);
transaction.Commit();
}
}
scope.Complete();
}
and simply using ?
using (ISession session = NHibernateHelper.OpenSession())
{
using (ITransaction transaction = session.BeginTransaction())
{
session.Delete(entity);
transaction.Commit();
}
}
What are the advantages and disadvanteges and when they are appropriate to use?