.Net中的Oracle连接池 [英] Oracle Connection Pooling in .Net

查看:100
本文介绍了.Net中的Oracle连接池的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用Oracle数据库的系统.我被问到系统是否利用了不确定的连接池.

We have a system that uses an Oracle database. I've been asked if the system makes use of connection pooling which I'm not sure about.

我们正在使用Oracle.DataAccess.Client.OracleConnection

在阅读主题时,我发现连接池在连接字符串中设置为true,并且默认情况下设置为true.

When reading up on the subject I've found that connection pooling is set to true in the connection string and that it is set to true by default.

我们的连接字符串不包含任何池设置.这是否意味着我们正在使用池,如果是,则默认的最小和最大池大小是多少?在隐式使用连接池(即未在连接字符串中指定)的情况下,我无法找到有关这些值的任何信息.

Our connection string does not include any pooling settings. Does this imply that we are using pooling and if so what would the default min and max pool size be? I've not been able to find any information on what these values would be in the case of using connection pooling implicitly (i.e. not specified in the connection string).

推荐答案

默认情况下,根据

Connection pooling is turned on by default as specified in the official ODP.NET documentation on Connection String Attributes (default: Pooling = true).

因此,如果您的连接字符串省略了任何类型的连接池设置,您将获得具有以下基本默认设置的连接池,同样基于相同的

So, if your connection string omits any kind of connection pool setting, you will get a connection pool with the following basic default settings, again based on that same official ODP.NET documentation page on Connection String Attributes:

  • Connection Timeout = 15:等待从池中进行免费连接的最长时间(以秒为单位).
  • Decr Pool Size = 1:未使用过多已建立连接时关闭的连接数.
  • Incr Pool Size = 5:使用池中的所有连接时要创建的新连接数.
  • Max Pool Size = 100:池中的最大连接数.
  • Min Pool Size = 1:池中的最小连接数.
  • Connection Timeout = 15: Maximum time (in seconds) to wait for a free connection from the pool.
  • Decr Pool Size = 1: Number of connections that are closed when an excessive amount of established connections are unused.
  • Incr Pool Size = 5: Number of new connections to be created when all connections in the pool are in use.
  • Max Pool Size = 100: Maximum number of connections in a pool.
  • Min Pool Size = 1: Minimum number of connections in a pool.

文档中还提到了其他一些有趣的默认池值,您可能还想了解一下.

The documentation mentions other interesting default pool values as well that you may want to read about as well.

这篇关于.Net中的Oracle连接池的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆