|
@@ -22,6 +22,7 @@ namespace ServiceCenter.SqlSugars
|
|
|
/// PLC据库连接Key
|
|
|
/// </summary>
|
|
|
private static string _PLCEX { get; set; } = "";
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// PLC据库连接Key
|
|
|
/// </summary>
|
|
@@ -152,7 +153,7 @@ namespace ServiceCenter.SqlSugars
|
|
|
var db = new SqlSugarHelper();
|
|
|
try
|
|
|
{
|
|
|
- db.Connect.BeginTran(IsolationLevel.ReadCommitted);//开始事务
|
|
|
+ db.Connect.BeginTran();//开始事务
|
|
|
if (_Default != "")
|
|
|
{
|
|
|
db.Default.Ado.CommandTimeOut = 10;
|
|
@@ -163,6 +164,7 @@ namespace ServiceCenter.SqlSugars
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
db.Connect.RollbackTran();//回滚事务
|
|
|
+ if (ex.Message.Contains("SqlTransaction")) throw new Exception($"{ex.Message}:{ex.StackTrace}");
|
|
|
throw new Exception(ex.Message);
|
|
|
}
|
|
|
}
|
|
@@ -189,8 +191,9 @@ namespace ServiceCenter.SqlSugars
|
|
|
catch (Exception ex)
|
|
|
{
|
|
|
db.Connect.RollbackTran();//回滚事务
|
|
|
+ if (ex.Message.Contains("SqlTransaction")) throw new Exception($"{ex.Message}:{ex.StackTrace}");
|
|
|
throw new Exception(ex.Message);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|