如何实现functionlity即控制"增量池大小"或QUOT; DECR池大小"同时建立连接到SQL?类似于Oracle大小、增量、类似于、连接到

2023-09-06 17:25:42 作者:伱走了心空了

我曾问一个关于增量池大小或DECR池大小

I have asked a question about "Incr Pool Size" or "Decr Pool Size"

How解决的SqlConnection错误"关键字不支持:DECR池大小'"

这是另一种,但不同的问题涉及到的是,在短暂的Oracle连接字符串提供了这两个选项来增加/减少连接对象时,连接池分别为空或满。如何才能与SQL实现这一目标。

This is another but different question related to that , in brief ORACLE connection string provides these two option to increase/decrease connection objects when connection pool is empty or full respectively. how can we achieve this with SQL.

编辑:为什么我想知道,因为我创建一个中间件,我现在用的多线程并行写入数据库(如60),我在想什么的时候,从池中所有的连接(如50)都在使用,新的一堆线程尝试建立连接将SQL Server将创建另一个一堆池连接,即50还是会由一个创建这个超连接吗?

Why I want to know because I am creating a middleware where I am writing to database using multiple parallel threads (e.g. 60), what I am thinking is when all my connections from pool (e.g. 50) are in use and new bunch of threads try to create connection will sql server will create another bunch of connection in pool i.e. 50 or will it create this exceeding connection one by one?

推荐答案

在SqlClient中自动管理池的大小,whithin的 MaxPoolSize 了MinPoolSize 提供的参数。的默认值是100和0。

The SqlClient manages the pool size automatically, whithin the MaxPoolSize and MinPoolSize parameters provided. The default values are 100 and 0, respectively.

 
精彩推荐
图片推荐