TADOConnection.Close - connection still active on MS-SQL server
I have several Delphi programs (XE3), that use a TADOConnection to connect to a MS-SQL Server. I recently checked the connections in the "MS SQL Server Management Studio"'s process list.
- When the program starts, the connection is inactive, no connection in the server's process list.
- When I open the connection it's shown in the process list - as expected.
- When I close the connection (definitely the property "Connected" returns FALSE), the connection is still shown on the servers process list.
On the server the Connection is not closed until I close the program.
Is there a way to close the TADOConnection in a way that really removes the connection on the server without exiting the program?
This is connection pooling; and is a good thing.
But if you really want to hurt performance, you can opt-out of connection pooling features by adding the request to your connection string:
Provider=SQLOLEDB;Data Source=myServerAddress;Initial Catalog=myDataBase;
User ID=myUsername;Password=correct horse battery stapler;OLE DB Services=-2;
These OLE DB Services options are documented on MSDN:
Pooling in the Microsoft Data Access Components (archive)
OLE DB Services Services enabled
=============== ==================================================
-1 All services (the default)
-2 All services except pooling
-4 All services except pooling and auto-enlistment
-5 All services except client cursor
-6 All services except client cursor and pooling
0 No services
来源:https://stackoverflow.com/questions/48705373/tadoconnection-close-connection-still-active-on-ms-sql-server
TADOConnection.Close - connection still active on MS-SQL server的更多相关文章
- (火炬)MS SQL Server数据库案例教程
(火炬)MS SQL Server数据库案例教程 创建数据库: CREATE DATABASE TDB //数据库名称 ON ( NAME=TDB_dat,//逻辑文件名 在创建数据库完成之后语句中引 ...
- Set up JBPM5.4 Final Installer to use MS SQL Server 2008 using JTDS(转)
[-] A What I Am Going To Do B The Setup Steps C Lets Install it A. What I Am Going To Do B. The Se ...
- java连接ms sql server各类问题解析
首先先来说下使用微软自己开发的架包进行ms sql server数据库的连接时,sql 2000与sql 2005的连接方式略有不同: 1.首先驱动不一样,sql 2000的连接驱动包有三个,分别是: ...
- MS SQL Server 数据库连接字符串详解
MS SQL Server 数据库连接字符串详解 原地址:http://blog.csdn.net/jhhja/article/details/6096565 问题 : 超时时间已到.在从池中获取连接 ...
- Datagrip连接SQLServer Connecting DataGrip to MS SQL Server
Connecting DataGrip to MS SQL Server Posted on June 21, 2016 by Maksim Sobolevskiy Some specific nee ...
- Server-side Query interception with MS SQL Server
up vote15down votefavorite 5 I'm researching into intercepting queries that arrive at the SQL Serv ...
- [MS SQL Server]SQL Server如何开启远程访问
在日常工作中,经常需要连接到远程的MS SQL Server数据库中.当然也经常会出现下面的连接错误. 解决方法: 1. 设置数据库允许远程连接,数据库实例名-->右键--->属性---C ...
- Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码)
Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码) http://blog.csdn.net/helonsy/article/details/7207497 ...
- MS SQL Server中数据表、视图、函数/方法、存储过程是否存在判断及创建
前言 在操作数据库的时候经常会用到判断数据表.视图.函数/方法.存储过程是否存在,若存在,则需要删除后再重新创建.以下是MS SQL Server中的示例代码. 数据表(Table) 创建数据表的时候 ...
随机推荐
- Windows10放开Administrator权限
手机上大家都喜欢使ROOT权限,root是超线用户的意思,但是Win10最高权限是Administrator管理员权限,但是系统默认是没有开启这个权限的需要系统安装好以后再次去开启. 方法/步骤 在桌 ...
- mfc 类
知识点 类的概念 类的相关术语 定义类 使用类 一.类的概念 简单的说类就是数据与函数综合体,它是用户自定义类型. 二.类的相关术语 类的实例称为对象. 类在定义中隐式地包含数据和操作函数,这种思想称 ...
- 学习和使用STL
STL是一个标准规范,它只是为容器.迭代器和泛型算法等组件定义了一整套统一的上层访问接口及各种组件之间搭配运用的一般规则,而没有定义组件底层的具体实现方法. STL主要包括下面这些组件:I/O流,st ...
- 游戏手柄(JoyStick)编程学习笔记(2)
在我的上一篇博客中(http://blog.csdn.net/liyuanbhu/article/details/51714045),介绍了通过 multimedia joystick API 来访问 ...
- 6 [面向对象]-property
1.特性(property) 什么是特性property property是一种特殊的属性,访问它时会执行一段功能(函数)然后返回值 例一:BMI指数(bmi是计算而来的,但很明显它听起来像是一个属性 ...
- Codeforces 908 D.New Year and Arbitrary Arrangement (概率&期望DP)
题目链接:New Year and Arbitrary Arrangement 题意: 有一个ab字符串,初始为空. 用Pa/(Pa+Pb)的概率在末尾添加字母a,有 Pb/(Pa+Pb)的概率在末尾 ...
- bootstrap图标显示为方框的解决方案
这是因为没有 fonts 库导致的,只需要放入项目目录即可正常显示图标
- c语言版本的coroutine
#include <stdio.h> int function(void) { ; switch (state) { : goto LABEL0; : goto LABEL1; } LAB ...
- 用docsify快速构建文档,并用GitHub Pages展示
什么是docsify 无需构建,写完 markdown 直接发布成文档,写说明文档的极佳选择. 快速上手 安装 npm i docsify-cli -g docsify init docs 创建项目 ...
- XAF-由于try catch导致的性能问题一例
前几天在制作PMMS系统时,有天突然发现性能问题下降严重,发布到客户机后,每点击一个按钮要花5-10秒的时间,与本机的200-600毫秒差距很大. 经过多处优化后没有效果. 后来想起,最近增加的功能是 ...