mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 17:20:49 +08:00 
			
		
		
		
	✨ support provider、Extensions Exceptions 多语言
This commit is contained in:
		@@ -22,12 +22,12 @@ namespace FreeSql.Oracle
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
            if (!string.IsNullOrEmpty(masterConnectionString))
 | 
			
		||||
                MasterPool = new OracleConnectionPool("主库", masterConnectionString, null, null);
 | 
			
		||||
                MasterPool = new OracleConnectionPool(CoreStrings.S_MasterDatabase, masterConnectionString, null, null);
 | 
			
		||||
            if (slaveConnectionStrings != null)
 | 
			
		||||
            {
 | 
			
		||||
                foreach (var slaveConnectionString in slaveConnectionStrings)
 | 
			
		||||
                {
 | 
			
		||||
                    var slavePool = new OracleConnectionPool($"从库{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
 | 
			
		||||
                    var slavePool = new OracleConnectionPool($"{CoreStrings.S_SlaveDatabase}{SlavePools.Count + 1}", slaveConnectionString, () => Interlocked.Decrement(ref slaveUnavailables), () => Interlocked.Increment(ref slaveUnavailables));
 | 
			
		||||
                    SlavePools.Add(slavePool);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
@@ -56,7 +56,7 @@ namespace FreeSql.Oracle
 | 
			
		||||
    {
 | 
			
		||||
 | 
			
		||||
        internal OracleConnectionPool _pool;
 | 
			
		||||
        public string Name { get; set; } = "Oracle Connection 对象池";
 | 
			
		||||
        public string Name { get; set; } = $"Oracle Connection {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);
 | 
			
		||||
@@ -132,8 +132,8 @@ namespace FreeSql.Oracle
 | 
			
		||||
            {
 | 
			
		||||
                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)
 | 
			
		||||
@@ -162,8 +162,8 @@ namespace FreeSql.Oracle
 | 
			
		||||
            {
 | 
			
		||||
                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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user