ADO.NET 后台池验证
ADO.NET background pool validation
在 Java 中,JBoss EAP 等应用程序服务器可以选择定期验证数据库池 (https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html/administration_and_configuration_guide/sect-database_connection_validation) 中的连接。这对于删除陈旧的连接非常有用。
我现在正在查看一个 ADO.NET 应用程序,我想知道是否有任何类似的功能可以与 Microsoft SQL 服务器一起使用?
我最终找到了 redgate 的 this post,它描述了从池中获取连接时进行的一些验证:
If the connection has died because a router has decided that it no
longer wants to forward your packets and no other routers like you
either then there is no way to know this unless you try to send some
data and don’t get a response.
If you create a connection and a connection pool is created and
connections are put into the pool and not used, the longer they are in
there, the bigger the chance of something bad happening to it.
When you go to use a connection there is nothing to warn you that a
router has stopped forwarding your packets until you go to use it; so
until you use it, you do not know that there is a problem.
This was an issue with connection pooling that was fixed in the first
.Net 4 reliability update (see issue 14 which vaguely describes this)
with a feature called “Connection Pool Resiliency”. The update meant
that when a connection is about to be taken from the pool, it is
checked for TCP validity and only returned if it is in a good state.
在 Java 中,JBoss EAP 等应用程序服务器可以选择定期验证数据库池 (https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/6.4/html/administration_and_configuration_guide/sect-database_connection_validation) 中的连接。这对于删除陈旧的连接非常有用。
我现在正在查看一个 ADO.NET 应用程序,我想知道是否有任何类似的功能可以与 Microsoft SQL 服务器一起使用?
我最终找到了 redgate 的 this post,它描述了从池中获取连接时进行的一些验证:
If the connection has died because a router has decided that it no longer wants to forward your packets and no other routers like you either then there is no way to know this unless you try to send some data and don’t get a response.
If you create a connection and a connection pool is created and connections are put into the pool and not used, the longer they are in there, the bigger the chance of something bad happening to it.
When you go to use a connection there is nothing to warn you that a router has stopped forwarding your packets until you go to use it; so until you use it, you do not know that there is a problem.
This was an issue with connection pooling that was fixed in the first .Net 4 reliability update (see issue 14 which vaguely describes this) with a feature called “Connection Pool Resiliency”. The update meant that when a connection is about to be taken from the pool, it is checked for TCP validity and only returned if it is in a good state.