diff --git a/Examples/base_entity/Program.cs b/Examples/base_entity/Program.cs index 366f7640..9aa30d74 100644 --- a/Examples/base_entity/Program.cs +++ b/Examples/base_entity/Program.cs @@ -106,9 +106,12 @@ namespace base_entity .UseAutoSyncStructure(true) .UseNoneCommandParameter(true) - .UseConnectionString(FreeSql.DataType.Sqlite, "data source=test.db;max pool size=5") + .UseConnectionString(FreeSql.DataType.Sqlite, "data source=test1.db;max pool size=5") + .UseSlave("data source=test1.db", "data source=test2.db", "data source=test3.db", "data source=test4.db") + .UseSlaveWeight(10, 1, 1, 5) - .UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;Max pool size=2") + + //.UseConnectionString(FreeSql.DataType.MySql, "Data Source=127.0.0.1;Port=3306;User ID=root;Password=root;Initial Catalog=cccddd;Charset=utf8;SslMode=none;Max pool size=2") //.UseConnectionString(FreeSql.DataType.SqlServer, "Data Source=.;Integrated Security=True;Initial Catalog=freesqlTest;Pooling=true;Max Pool Size=3") @@ -131,13 +134,16 @@ namespace base_entity //.UseConnectionString(FreeSql.DataType.OdbcDameng, "Driver={DM8 ODBC DRIVER};Server=127.0.0.1:5236;Persist Security Info=False;Trusted_Connection=Yes;UID=USER1;PWD=123456789") - .UseMonitorCommand(umcmd => Console.WriteLine(umcmd.CommandText)) + .UseMonitorCommand(null, (umcmd, log) => Console.WriteLine(umcmd.Connection.ConnectionString + ":" + umcmd.CommandText)) .UseLazyLoading(true) .UseGenerateCommandParameterWithLambda(true) .Build(); BaseEntity.Initialization(fsql, () => _asyncUow.Value); #endregion + for (var a = 0; a < 10000; a++) + fsql.Select().First(); + for (var a = 0; a < 1000; a++) { fsql.Transaction(() => diff --git a/FreeSql/FreeSql.xml b/FreeSql/FreeSql.xml index 4caa4edf..7c59a530 100644 --- a/FreeSql/FreeSql.xml +++ b/FreeSql/FreeSql.xml @@ -4314,6 +4314,11 @@ 后台定时检查可用性间隔秒数 + + + 权重 + + 对象池的对象被创建时 diff --git a/FreeSql/FreeSqlBuilder.cs b/FreeSql/FreeSqlBuilder.cs index 04dd8934..9ef6fe46 100644 --- a/FreeSql/FreeSqlBuilder.cs +++ b/FreeSql/FreeSqlBuilder.cs @@ -14,6 +14,7 @@ namespace FreeSql DataType _dataType; string _masterConnectionString; string[] _slaveConnectionString; + int[] _slaveWeights; Func _connectionFactory; bool _isAutoSyncStructure = false; bool _isSyncStructureToLower = false; @@ -55,6 +56,12 @@ namespace FreeSql _slaveConnectionString = slaveConnectionString; return this; } + public FreeSqlBuilder UseSlaveWeight(params int[] slaveWeights) + { + if (_slaveConnectionString?.Length != slaveWeights.Length) throw new Exception("SlaveConnectionString 数量与 SlaveWeights 不相同"); + _slaveWeights = slaveWeights; + return this; + } /// /// 使用自定义数据库连接对象(放弃内置对象连接池技术) /// @@ -458,6 +465,9 @@ namespace FreeSql ret.Ado.MasterPool.Policy.IsAutoDisposeWithSystem = _isExitAutoDisposePool; ret.Ado.SlavePools.ForEach(a => a.Policy.IsAutoDisposeWithSystem = _isExitAutoDisposePool); + if (_slaveWeights != null) + for (var x = 0; x < _slaveWeights.Length; x++) + ret.Ado.SlavePools[x].Policy.Weight = _slaveWeights[x]; } return ret; diff --git a/FreeSql/Internal/CommonProvider/AdoProvider/AdoProvider.cs b/FreeSql/Internal/CommonProvider/AdoProvider/AdoProvider.cs index d5c7b3e0..0c82881c 100644 --- a/FreeSql/Internal/CommonProvider/AdoProvider/AdoProvider.cs +++ b/FreeSql/Internal/CommonProvider/AdoProvider/AdoProvider.cs @@ -582,7 +582,20 @@ namespace FreeSql.Internal.CommonProvider if (availables.Any()) { isSlave = true; - pool = availables.Count == 1 ? availables[0] : availables[slaveRandom.Next(availables.Count)]; + if (availables.Count == 1) pool = availables[0]; + else + { + var rnd = slaveRandom.Next(availables.Sum(a => a.Policy.Weight)); + for(var a = 0; a < availables.Count; a++) + { + rnd -= availables[a].Policy.Weight; + if (rnd < 0) + { + pool = availables[a]; + break; + } + } + } } } } diff --git a/FreeSql/Internal/CommonProvider/AdoProvider/DbConnectionPool.cs b/FreeSql/Internal/CommonProvider/AdoProvider/DbConnectionPool.cs index 03cc643d..f445b499 100644 --- a/FreeSql/Internal/CommonProvider/AdoProvider/DbConnectionPool.cs +++ b/FreeSql/Internal/CommonProvider/AdoProvider/DbConnectionPool.cs @@ -110,6 +110,7 @@ namespace FreeSql.Internal.CommonProvider public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; public DbConnection OnCreate() { diff --git a/FreeSql/Internal/ObjectPool/DefaultPolicy.cs b/FreeSql/Internal/ObjectPool/DefaultPolicy.cs index 1e7e47a0..e505e273 100644 --- a/FreeSql/Internal/ObjectPool/DefaultPolicy.cs +++ b/FreeSql/Internal/ObjectPool/DefaultPolicy.cs @@ -17,6 +17,7 @@ namespace FreeSql.Internal.ObjectPool public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; public Func CreateObject; public Action> OnGetObject; diff --git a/FreeSql/Internal/ObjectPool/IPolicy.cs b/FreeSql/Internal/ObjectPool/IPolicy.cs index 9a2b40d6..a4662db1 100644 --- a/FreeSql/Internal/ObjectPool/IPolicy.cs +++ b/FreeSql/Internal/ObjectPool/IPolicy.cs @@ -48,6 +48,11 @@ namespace FreeSql.Internal.ObjectPool /// int CheckAvailableInterval { get; set; } + /// + /// 权重 + /// + int Weight { get; set; } + /// /// 对象池的对象被创建时 /// diff --git a/Providers/FreeSql.Provider.ClickHouse/ClickHouseAdo/ClickHouseConnectionPool.cs b/Providers/FreeSql.Provider.ClickHouse/ClickHouseAdo/ClickHouseConnectionPool.cs index b217c586..eb1bd06f 100644 --- a/Providers/FreeSql.Provider.ClickHouse/ClickHouseAdo/ClickHouseConnectionPool.cs +++ b/Providers/FreeSql.Provider.ClickHouse/ClickHouseAdo/ClickHouseConnectionPool.cs @@ -64,6 +64,7 @@ namespace FreeSql.ClickHouse public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Dameng/DamengAdo/DamengConnectionPool.cs b/Providers/FreeSql.Provider.Dameng/DamengAdo/DamengConnectionPool.cs index b10d3749..c7085cc2 100644 --- a/Providers/FreeSql.Provider.Dameng/DamengAdo/DamengConnectionPool.cs +++ b/Providers/FreeSql.Provider.Dameng/DamengAdo/DamengConnectionPool.cs @@ -68,6 +68,7 @@ namespace FreeSql.Dameng public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Firebird/FirebirdAdo/FirebirdConnectionPool.cs b/Providers/FreeSql.Provider.Firebird/FirebirdAdo/FirebirdConnectionPool.cs index 8b0c930a..65961f26 100644 --- a/Providers/FreeSql.Provider.Firebird/FirebirdAdo/FirebirdConnectionPool.cs +++ b/Providers/FreeSql.Provider.Firebird/FirebirdAdo/FirebirdConnectionPool.cs @@ -52,6 +52,7 @@ namespace FreeSql.Firebird public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.GBase/GBaseAdo/GBaseConnectionPool.cs b/Providers/FreeSql.Provider.GBase/GBaseAdo/GBaseConnectionPool.cs index 2bf9e8c7..5c803c21 100644 --- a/Providers/FreeSql.Provider.GBase/GBaseAdo/GBaseConnectionPool.cs +++ b/Providers/FreeSql.Provider.GBase/GBaseAdo/GBaseConnectionPool.cs @@ -52,6 +52,7 @@ namespace FreeSql.GBase public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.KingbaseES/KingbaseESAdo/KingbaseESConnectionPool.cs b/Providers/FreeSql.Provider.KingbaseES/KingbaseESAdo/KingbaseESConnectionPool.cs index 44e2b2e9..f5dec5c9 100644 --- a/Providers/FreeSql.Provider.KingbaseES/KingbaseESAdo/KingbaseESConnectionPool.cs +++ b/Providers/FreeSql.Provider.KingbaseES/KingbaseESAdo/KingbaseESConnectionPool.cs @@ -74,6 +74,7 @@ namespace FreeSql.KingbaseES public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessConnectionPool.cs b/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessConnectionPool.cs index e27ac4af..0c019330 100644 --- a/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessConnectionPool.cs +++ b/Providers/FreeSql.Provider.MsAccess/MsAccessAdo/MsAccessConnectionPool.cs @@ -57,6 +57,7 @@ namespace FreeSql.MsAccess public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; private string _connectionString; public string ConnectionString diff --git a/Providers/FreeSql.Provider.MySql/MySqlAdo/MySqlConnectionPool.cs b/Providers/FreeSql.Provider.MySql/MySqlAdo/MySqlConnectionPool.cs index 770194fe..f9a6b7a7 100644 --- a/Providers/FreeSql.Provider.MySql/MySqlAdo/MySqlConnectionPool.cs +++ b/Providers/FreeSql.Provider.MySql/MySqlAdo/MySqlConnectionPool.cs @@ -56,6 +56,7 @@ namespace FreeSql.MySql public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengAdo/OdbcDamengConnectionPool.cs b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengAdo/OdbcDamengConnectionPool.cs index 61ac9b87..76c2a573 100644 --- a/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengAdo/OdbcDamengConnectionPool.cs +++ b/Providers/FreeSql.Provider.Odbc/Dameng/OdbcDamengAdo/OdbcDamengConnectionPool.cs @@ -74,6 +74,7 @@ namespace FreeSql.Odbc.Dameng public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Odbc/Default/OdbcAdo/OdbcConnectionPool.cs b/Providers/FreeSql.Provider.Odbc/Default/OdbcAdo/OdbcConnectionPool.cs index 3379c7b0..783b2db9 100644 --- a/Providers/FreeSql.Provider.Odbc/Default/OdbcAdo/OdbcConnectionPool.cs +++ b/Providers/FreeSql.Provider.Odbc/Default/OdbcAdo/OdbcConnectionPool.cs @@ -57,6 +57,7 @@ namespace FreeSql.Odbc.Default public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Odbc/KingbaseES/OdbcKingbaseESAdo/OdbcKingbaseESConnectionPool.cs b/Providers/FreeSql.Provider.Odbc/KingbaseES/OdbcKingbaseESAdo/OdbcKingbaseESConnectionPool.cs index a7d5f273..60010ae2 100644 --- a/Providers/FreeSql.Provider.Odbc/KingbaseES/OdbcKingbaseESAdo/OdbcKingbaseESConnectionPool.cs +++ b/Providers/FreeSql.Provider.Odbc/KingbaseES/OdbcKingbaseESAdo/OdbcKingbaseESConnectionPool.cs @@ -74,6 +74,7 @@ namespace FreeSql.Odbc.KingbaseES public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlAdo/OdbcMySqlConnectionPool.cs b/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlAdo/OdbcMySqlConnectionPool.cs index 361de661..df2e22c7 100644 --- a/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlAdo/OdbcMySqlConnectionPool.cs +++ b/Providers/FreeSql.Provider.Odbc/MySql/OdbcMySqlAdo/OdbcMySqlConnectionPool.cs @@ -52,6 +52,7 @@ namespace FreeSql.Odbc.MySql public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleAdo/OdbcOracleConnectionPool.cs b/Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleAdo/OdbcOracleConnectionPool.cs index cf65c0a4..0da4b66a 100644 --- a/Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleAdo/OdbcOracleConnectionPool.cs +++ b/Providers/FreeSql.Provider.Odbc/Oracle/OdbcOracleAdo/OdbcOracleConnectionPool.cs @@ -74,6 +74,7 @@ namespace FreeSql.Odbc.Oracle public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLAdo/OdbcPostgreSQLConnectionPool.cs b/Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLAdo/OdbcPostgreSQLConnectionPool.cs index 4b4b0634..a6fb1096 100644 --- a/Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLAdo/OdbcPostgreSQLConnectionPool.cs +++ b/Providers/FreeSql.Provider.Odbc/PostgreSQL/OdbcPostgreSQLAdo/OdbcPostgreSQLConnectionPool.cs @@ -64,6 +64,7 @@ namespace FreeSql.Odbc.PostgreSQL public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerAdo/OdbcSqlServerConnectionPool.cs b/Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerAdo/OdbcSqlServerConnectionPool.cs index a66af427..70906e5a 100644 --- a/Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerAdo/OdbcSqlServerConnectionPool.cs +++ b/Providers/FreeSql.Provider.Odbc/SqlServer/OdbcSqlServerAdo/OdbcSqlServerConnectionPool.cs @@ -57,6 +57,7 @@ namespace FreeSql.Odbc.SqlServer public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Oracle/OracleAdo/OracleConnectionPool.cs b/Providers/FreeSql.Provider.Oracle/OracleAdo/OracleConnectionPool.cs index 3dc769fd..3af56509 100644 --- a/Providers/FreeSql.Provider.Oracle/OracleAdo/OracleConnectionPool.cs +++ b/Providers/FreeSql.Provider.Oracle/OracleAdo/OracleConnectionPool.cs @@ -74,6 +74,7 @@ namespace FreeSql.Oracle public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLConnectionPool.cs b/Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLConnectionPool.cs index d6d6f29f..cce2e648 100644 --- a/Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLConnectionPool.cs +++ b/Providers/FreeSql.Provider.PostgreSQL/PostgreSQLAdo/PostgreSQLConnectionPool.cs @@ -64,6 +64,7 @@ namespace FreeSql.PostgreSQL public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.ShenTong/ShenTongAdo/ShenTongConnectionPool.cs b/Providers/FreeSql.Provider.ShenTong/ShenTongAdo/ShenTongConnectionPool.cs index 43c1766b..a375a4f7 100644 --- a/Providers/FreeSql.Provider.ShenTong/ShenTongAdo/ShenTongConnectionPool.cs +++ b/Providers/FreeSql.Provider.ShenTong/ShenTongAdo/ShenTongConnectionPool.cs @@ -62,6 +62,7 @@ namespace FreeSql.ShenTong public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.SqlServer/SqlServerAdo/SqlServerConnectionPool.cs b/Providers/FreeSql.Provider.SqlServer/SqlServerAdo/SqlServerConnectionPool.cs index 4ab167c7..32b12918 100644 --- a/Providers/FreeSql.Provider.SqlServer/SqlServerAdo/SqlServerConnectionPool.cs +++ b/Providers/FreeSql.Provider.SqlServer/SqlServerAdo/SqlServerConnectionPool.cs @@ -61,6 +61,7 @@ namespace FreeSql.SqlServer public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; static ConcurrentDictionary dicConnStrIncr = new ConcurrentDictionary(StringComparer.CurrentCultureIgnoreCase); private string _connectionString; diff --git a/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteConnectionPool.cs b/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteConnectionPool.cs index 9185c56e..7ed19d00 100644 --- a/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteConnectionPool.cs +++ b/Providers/FreeSql.Provider.Sqlite/SqliteAdo/SqliteConnectionPool.cs @@ -64,6 +64,7 @@ namespace FreeSql.Sqlite public bool IsThrowGetTimeoutException { get; set; } = true; public bool IsAutoDisposeWithSystem { get; set; } = true; public int CheckAvailableInterval { get; set; } = 5; + public int Weight { get; set; } = 1; public string[] Attaches = new string[0]; private string _connectionString;