发布x.3.1.77修复动态添加从库bug

This commit is contained in:
xuejiaming 2021-12-10 18:18:47 +08:00
parent fe7275882d
commit 1d3f36b388
8 changed files with 20 additions and 22 deletions

View File

@ -1,9 +1,9 @@
:start :start
::定义版本 ::定义版本
set EFCORE2=2.3.1.76 set EFCORE2=2.3.1.77
set EFCORE3=3.3.1.76 set EFCORE3=3.3.1.77
set EFCORE5=5.3.1.76 set EFCORE5=5.3.1.77
set EFCORE6=6.3.1.76 set EFCORE6=6.3.1.77
::删除所有bin与obj下的文件 ::删除所有bin与obj下的文件
@echo off @echo off

View File

@ -103,7 +103,9 @@ namespace ShardingCore.DIExtensions
public bool? IgnoreCreateTableError { get; set; } = true; public bool? IgnoreCreateTableError { get; set; } = true;
public int MaxQueryConnectionsLimit { get; set; } = Environment.ProcessorCount; public int MaxQueryConnectionsLimit { get; set; } = Environment.ProcessorCount;
public ConnectionModeEnum ConnectionMode { get; set; } = ConnectionModeEnum.SYSTEM_AUTO; public ConnectionModeEnum ConnectionMode { get; set; } = ConnectionModeEnum.SYSTEM_AUTO;
[Obsolete]
public bool? EnableTableRouteCompileCache { get; set; } public bool? EnableTableRouteCompileCache { get; set; }
[Obsolete]
public bool? EnableDataSourceRouteCompileCache { get; set; } public bool? EnableDataSourceRouteCompileCache { get; set; }
private readonly ISet<Type> _createTableEntities = new HashSet<Type>(); private readonly ISet<Type> _createTableEntities = new HashSet<Type>();

View File

@ -67,15 +67,6 @@ namespace ShardingCore.Extensions
#endif #endif
} }
/// <summary>
/// 移除所有的没有分片的表
/// </summary>
/// <param name="dbContext"></param>
[Obsolete($"plz use {nameof(RemoveDbContextAllRelationModelThatIsNoSharding)}")]
public static void RemoveDbContextAllRelationModelThatIsNoShardingTable(this DbContext dbContext)
{
RemoveDbContextAllRelationModelThatIsNoSharding(dbContext);
}
/// <summary> /// <summary>
/// 移除所有的没有分片的表 /// 移除所有的没有分片的表
/// </summary> /// </summary>

View File

@ -49,15 +49,20 @@ namespace ShardingCore.Sharding.ReadWriteConfigurations
if (_readWriteOptions.ReadStrategy == ReadStrategyEnum.Loop) if (_readWriteOptions.ReadStrategy == ReadStrategyEnum.Loop)
{ {
connector= new ReadWriteLoopConnector(dataSourceName, new List<string> { connectionString }); connector= new ReadWriteLoopConnector(dataSourceName, new List<string> { connectionString });
_connectors.TryAdd(dataSourceName, connector);
return true;
} }
else if (_readWriteOptions.ReadStrategy == ReadStrategyEnum.Random) else if (_readWriteOptions.ReadStrategy == ReadStrategyEnum.Random)
{ {
connector= new ReadWriteLoopConnector(dataSourceName, new List<string> { connectionString }); connector= new ReadWriteRandomConnector(dataSourceName, new List<string> { connectionString });
_connectors.TryAdd(dataSourceName, connector);
return true;
} }
else
{
throw new ShardingCoreInvalidOperationException( throw new ShardingCoreInvalidOperationException(
$"unknown read write strategy:[{_readWriteOptions.ReadStrategy}]"); $"unknown read write strategy:[{_readWriteOptions.ReadStrategy}]");
}
} }
else else
{ {

View File

@ -4,7 +4,7 @@
<Version>$(EFCORE6)</Version> <Version>$(EFCORE6)</Version>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo> <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<DefineConstants>TRACE;DEBUG;EFCORE6;</DefineConstants> <DefineConstants>TRACE;DEBUG;EFCORE6;</DefineConstants>
<LangVersion>10.0</LangVersion> <LangVersion>9.0</LangVersion>
<RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl> <RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl>
<PackageIcon>logo.png</PackageIcon> <PackageIcon>logo.png</PackageIcon>
</PropertyGroup> </PropertyGroup>

View File

@ -6,7 +6,7 @@
<Version>$(EFCORE2)</Version> <Version>$(EFCORE2)</Version>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo> <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<DefineConstants>TRACE;DEBUG;EFCORE2;</DefineConstants> <DefineConstants>TRACE;DEBUG;EFCORE2;</DefineConstants>
<LangVersion>10.0</LangVersion> <LangVersion>9.0</LangVersion>
<AssemblyName>ShardingCore</AssemblyName> <AssemblyName>ShardingCore</AssemblyName>
<RootNamespace>ShardingCore</RootNamespace> <RootNamespace>ShardingCore</RootNamespace>
<RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl> <RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl>

View File

@ -6,7 +6,7 @@
<Version>$(EFCORE3)</Version> <Version>$(EFCORE3)</Version>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo> <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<DefineConstants>TRACE;DEBUG;EFCORE3;</DefineConstants> <DefineConstants>TRACE;DEBUG;EFCORE3;</DefineConstants>
<LangVersion>10.0</LangVersion> <LangVersion>9.0</LangVersion>
<AssemblyName>ShardingCore</AssemblyName> <AssemblyName>ShardingCore</AssemblyName>
<RootNamespace>ShardingCore</RootNamespace> <RootNamespace>ShardingCore</RootNamespace>
<RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl> <RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl>

View File

@ -5,7 +5,7 @@
<Version>$(EFCORE5)</Version> <Version>$(EFCORE5)</Version>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo> <GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<DefineConstants>TRACE;DEBUG;EFCORE5;</DefineConstants> <DefineConstants>TRACE;DEBUG;EFCORE5;</DefineConstants>
<LangVersion>10.0</LangVersion> <LangVersion>9.0</LangVersion>
<AssemblyName>ShardingCore</AssemblyName> <AssemblyName>ShardingCore</AssemblyName>
<RootNamespace>ShardingCore</RootNamespace> <RootNamespace>ShardingCore</RootNamespace>
<RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl> <RepositoryUrl>https://github.com/xuejmnet/sharding-core</RepositoryUrl>