mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 01:05:27 +08:00 
			
		
		
		
	- 优化 ConnectionPool 提升被动连接断开的体验(会卡的可以升级);
This commit is contained in:
		@@ -118,7 +118,8 @@ namespace FreeSql.PostgreSQL
 | 
			
		||||
 | 
			
		||||
        public void OnDestroy(DbConnection obj)
 | 
			
		||||
        {
 | 
			
		||||
            if (obj.State != ConnectionState.Closed) obj.Close();
 | 
			
		||||
            try { if (obj.State != ConnectionState.Closed) obj.Close(); } catch { }
 | 
			
		||||
            try { NpgsqlConnection.ClearPool(obj as NpgsqlConnection); } catch { }
 | 
			
		||||
            obj.Dispose();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@@ -188,7 +189,7 @@ namespace FreeSql.PostgreSQL
 | 
			
		||||
 | 
			
		||||
        public void OnReturn(Object<DbConnection> obj)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            //if (obj?.Value != null && obj.Value.State != ConnectionState.Closed) try { obj.Value.Close(); } catch { }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void OnAvailable()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user