support provider、Extensions Exceptions 多语言

This commit is contained in:
igeekfan
2022-06-10 03:05:27 +08:00
parent e9949b58ff
commit 4fa125e93c
128 changed files with 1369 additions and 608 deletions

View File

@ -45,7 +45,7 @@ namespace FreeSql.Odbc.MySql
{
internal OdbcMySqlConnectionPool _pool;
public string Name { get; set; } = "MySql OdbcConnection 对象池";
public string Name { get; set; } = $"MySql OdbcConnection {CoreStrings.S_ObjectPool}";
public int PoolSize { get; set; } = 100;
public TimeSpan SyncGetTimeout { get; set; } = TimeSpan.FromSeconds(10);
public TimeSpan IdleTimeout { get; set; } = TimeSpan.FromSeconds(20);
@ -120,8 +120,8 @@ namespace FreeSql.Odbc.MySql
{
if (obj.Value == null)
{
_pool.SetUnavailable(new Exception("连接字符串错误"), obj.LastGetTimeCopy);
throw new Exception($"【{this.Name}】连接字符串错误,请检查。");
_pool.SetUnavailable(new Exception(CoreStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreStrings.S_ConnectionStringError_Check(this.Name));
}
if (obj.Value.State != ConnectionState.Open || DateTime.Now.Subtract(obj.LastReturnTime).TotalSeconds > 60 && obj.Value.Ping() == false)
@ -150,8 +150,8 @@ namespace FreeSql.Odbc.MySql
{
if (obj.Value == null)
{
_pool.SetUnavailable(new Exception("连接字符串错误"), obj.LastGetTimeCopy);
throw new Exception($"【{this.Name}】连接字符串错误,请检查。");
_pool.SetUnavailable(new Exception(CoreStrings.S_ConnectionStringError), obj.LastGetTimeCopy);
throw new Exception(CoreStrings.S_ConnectionStringError_Check(this.Name));
}
if (obj.Value.State != ConnectionState.Open || DateTime.Now.Subtract(obj.LastReturnTime).TotalSeconds > 60 && (await obj.Value.PingAsync()) == false)