连接Liftime选项不生效 [英] Connection Liftime option doesn't take effect

查看:71
本文介绍了连接Liftime选项不生效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VB .Net实现数据库应用程序
我想关闭数据库连接,并在空闲30秒后从连接池中删除它.因此,我进行了一些研究,并认为连接生命周期"属性是我需要的.然后我将此设置添加到我的连接字符串中 而且我的以下实验无法正常工作.连接进入TIME_WAIT状态通常需要5分钟.

I am implementing a database application using VB .Net
I would like to have the database connection closed and removed from the connection pool after it is idle for 30 seconds. So I did some research and think "Connection Lifetime" property is what I needed. Then I added this setting into my connection string and my experiment below doesn't work. It always takes 5 minutes for the connection goes to TIME_WAIT state.

这是我的实验,我开始了mdi称呼,点击菜单项以打开表格.在加载表单时,调用  Me.MyTableAdapter.Fill,然后关闭此表单(不是应用程序),我认为连接将返回到池中 之后,闲置30秒后,连接将关闭.但显然并非如此.

Here is my experiment, I started a mdi applliation, clicked a menu item to open a form. On form load,  Me.MyTableAdapter.Fill is called and then I close this form(not the application) I thought that connection will be returned to the pool after this and after 30 seconds idle, the connection will be closed. But obviously, it is not the case.

感谢您的帮助.

 

 

 

 

推荐答案

 

谢谢您的发帖!  ;我建议将您的问题发布到MS论坛之一中,

数据开发人员中心 > 数据平台开发论坛 > ADO.NET数据集
Data Developer Center > Data Platform Development Forums > ADO.NET DataSet


这篇关于连接Liftime选项不生效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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