mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Multi-tenant performance optimization
This commit is contained in:
parent
0e47c98431
commit
9345ef7a12
@ -25,6 +25,7 @@ namespace SqlSugar
|
||||
private IgnoreColumnList _IgnoreInsertColumns;
|
||||
internal Guid? AsyncId { get; set; }
|
||||
internal bool? IsSingleInstance { get; set; }
|
||||
internal List<string> GetConnectionConfigIds = new List<string>();
|
||||
|
||||
#endregion
|
||||
|
||||
@ -625,6 +626,7 @@ namespace SqlSugar
|
||||
{
|
||||
db.Context.CurrentConnectionConfig.AopEvents = new AopEvents();
|
||||
}
|
||||
this.GetConnectionConfigIds.Add(configId+"");
|
||||
return db.Context;
|
||||
}
|
||||
public bool IsAnyConnection(dynamic configId)
|
||||
@ -665,7 +667,17 @@ namespace SqlSugar
|
||||
public void BeginTran()
|
||||
{
|
||||
_IsAllTran = true;
|
||||
AllClientEach(it => it.Ado.BeginTran());
|
||||
AllClientEach(it =>
|
||||
{
|
||||
if (this.GetConnectionConfigIds.Any()&&this.GetConnectionConfigIds.Contains(it.CurrentConnectionConfig.ConfigId))
|
||||
{
|
||||
it.Ado.BeginTran();
|
||||
}
|
||||
else
|
||||
{
|
||||
it.Ado.BeginTran();
|
||||
}
|
||||
});
|
||||
}
|
||||
public void CommitTran()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user