LLBLGEN 4.0
LLBLGEN Runtime Framework
C# Windows App
.Net Framework 4.0
SQL 2008 Server
Hi, In the below code, is it necessary to add "RollBack" as I have done or is it ok that I dont add Rollback and it rollsback by itself on failure ?
public static bool Delete(int titleid)
{
var transactionmanager = new Transaction(IsolationLevel.ReadCommitted, "MyTx");
try
{
var title = new TitleEntity();
title.Titleid = titleid;
title.IsNew = false;
title.Modifieddate = DateTimeClass.Currentdatetime();
title.Flag = PublicConstantClass.Deletedflag;
title.Modifieduserid = PublicConstantClass.Userid;
var result = title.Save();
transactionmanager.Commit();
return result;
}
catch (Exception ex)
{
transactionmanager.Rollback();
ErrorHandlerClass.LogMessage(ex.Message + ex.StackTrace);
throw;
}
}