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