事务处理

master
2 years ago
parent a604957a64
commit 9169a8b4c5

@ -749,8 +749,14 @@ namespace Khd.Core.Wcs.Wcs
}
}
catch (Exception ex)
{
try
{
transaction.Rollback();
}
catch
{
}
if (ex is PlcException)
{

@ -467,8 +467,15 @@ namespace Khd.Core.Wcs.Wcs
dbContextTransaction.Commit();
}
catch (Exception ex)
{
try
{
dbContextTransaction.Rollback();
}
catch
{
}
_logger.Error(ex.Message + "\n" + ex.StackTrace);
}
}

@ -768,8 +768,15 @@ namespace Khd.Core.Wcs.Wcs
_logger.Info("二楼AGV线程完成任务" + item.objid);
}
catch (Exception ex)
{
try
{
transaction.Rollback();
}
catch
{
}
_logger.Error(ex.Message + "\n" + ex.StackTrace);
}
}

@ -603,8 +603,15 @@ namespace Khd.Core.Wcs.Wcs
transaction.Commit();
}
catch (Exception ex)
{
try
{
transaction.Rollback();
}
catch
{
}
_logger.Error(ex.Message + "\n" + ex.StackTrace);
}
}

Loading…
Cancel
Save