private bool SaveAll()
{
TransactionOptions transactionOption = new TransactionOptions();
transactionOption.Timeout = new TimeSpan(0, 0, 600);
using (TransactionScope tscope = new TransactionScope(TransactionScopeOption.Required, transactionOption))
{
using (SharedDbConnectionScope scope = new SharedDbConnectionScope())
{
try
{
//语句
tscope.Complete();
return true;
}
catch (Exception Ee)
{
tscope.Dispose();
logger.Warn(string.Format("错误:错误描绘“{0}”", Ee.Message));
return false;
}
}
}
}
转载于:https://www.cnblogs.com/java20130725/archive/2012/08/01/3215417.html