mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-27 03:09:34 +08:00
Add DisableWithNoLockWithTran
This commit is contained in:
@@ -1820,7 +1820,14 @@ namespace SqlSugar
|
||||
var moreSetts = this.Context.CurrentConnectionConfig.MoreSettings;
|
||||
if (moreSetts != null && moreSetts.IsWithNoLockQuery && string.IsNullOrEmpty(QueryBuilder.TableWithString))
|
||||
{
|
||||
this.With(SqlWith.NoLock);
|
||||
if (moreSetts.DisableWithNoLockWithTran&&this.Context.Ado.IsAnyTran())
|
||||
{
|
||||
//No With(nolock)
|
||||
}
|
||||
else
|
||||
{
|
||||
this.With(SqlWith.NoLock);
|
||||
}
|
||||
}
|
||||
}
|
||||
protected List<TResult> GetData<TResult>(KeyValuePair<string, List<SugarParameter>> sqlObj)
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace SqlSugar
|
||||
{
|
||||
public bool IsAutoRemoveDataCache { get; set; }
|
||||
public bool IsWithNoLockQuery { get; set; }
|
||||
public bool DisableWithNoLockWithTran { get; set; }
|
||||
public bool IsWithNoLockSubquery { get; set; }
|
||||
|
||||
public bool DisableNvarchar { get; set; }
|
||||
|
||||
@@ -641,6 +641,7 @@ namespace SqlSugar
|
||||
PgSqlIsAutoToLowerCodeFirst= it.MoreSettings.PgSqlIsAutoToLowerCodeFirst,
|
||||
IsAutoRemoveDataCache = it.MoreSettings.IsAutoRemoveDataCache,
|
||||
IsWithNoLockQuery = it.MoreSettings.IsWithNoLockQuery,
|
||||
DisableWithNoLockWithTran=it.MoreSettings.DisableWithNoLockWithTran,
|
||||
TableEnumIsString = it.MoreSettings.TableEnumIsString,
|
||||
DisableMillisecond = it.MoreSettings.DisableMillisecond,
|
||||
DbMinDate=it.MoreSettings.DbMinDate,
|
||||
|
||||
Reference in New Issue
Block a user