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的更多相关文章

  1. (火炬)MS SQL Server数据库案例教程

    (火炬)MS SQL Server数据库案例教程 创建数据库: CREATE DATABASE TDB //数据库名称 ON ( NAME=TDB_dat,//逻辑文件名 在创建数据库完成之后语句中引 ...

  2. 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 ...

  3. java连接ms sql server各类问题解析

    首先先来说下使用微软自己开发的架包进行ms sql server数据库的连接时,sql 2000与sql 2005的连接方式略有不同: 1.首先驱动不一样,sql 2000的连接驱动包有三个,分别是: ...

  4. MS SQL Server 数据库连接字符串详解

    MS SQL Server 数据库连接字符串详解 原地址:http://blog.csdn.net/jhhja/article/details/6096565 问题 : 超时时间已到.在从池中获取连接 ...

  5. 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 ...

  6. Server-side Query interception with MS SQL Server

      up vote15down votefavorite 5 I'm researching into intercepting queries that arrive at the SQL Serv ...

  7. [MS SQL Server]SQL Server如何开启远程访问

    在日常工作中,经常需要连接到远程的MS SQL Server数据库中.当然也经常会出现下面的连接错误. 解决方法: 1. 设置数据库允许远程连接,数据库实例名-->右键--->属性---C ...

  8. Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码)

    Linux下使用FreeTDS访问MS SQL Server 2005数据库(包含C测试源码) http://blog.csdn.net/helonsy/article/details/7207497 ...

  9. MS SQL Server中数据表、视图、函数/方法、存储过程是否存在判断及创建

    前言 在操作数据库的时候经常会用到判断数据表.视图.函数/方法.存储过程是否存在,若存在,则需要删除后再重新创建.以下是MS SQL Server中的示例代码. 数据表(Table) 创建数据表的时候 ...

随机推荐

  1. 2017-2018-1 20155232 《信息安全系统设计基础》第十周课堂测试(ch06)补交

    # 2017-2018-1 20155232 <信息安全系统设计基础>第十周课堂测试(ch06)补交 上课时完成测试后在提交的时候,没有提交成功,进行补交. 1.下面代码中,对数组x填充后 ...

  2. WPF 播放Flash

    原文:WPF 播放Flash WPF中没有直接提供播放Flash的控件. 可以使用WebBrowser来打开,代码如下: <Window x:Class="Nankang.Itacat ...

  3. PostgreSQL参数学习:deadlock_timeout

    磨砺技术珠矶,践行数据之道,追求卓越价值回到上一级页面:PostgreSQL基础知识与基本操作索引页    回到顶级页面:PostgreSQL索引页[作者 高健@博客园  luckyjackgao@g ...

  4. python线程的使用模式

    为了解决阻塞(如I/O)问题,我们需要对程序进行并发设计. 本文将通过将线程和队列 结合在一起,轻松地在 Python 中完成线程编程,创建一些简单但有效的线程使用模式. 一.使用线程 先看一个线程不 ...

  5. 柯朗微积分与数学分析习题选解(1.1 节 a)

    一直在读<陶哲轩实分析>,陶的书非常的严谨,环环相扣,但是也有个缺点就是计算性的例子和应用方面的例子太少了.所以就又找了本柯朗的<微积分与数学分析>搭配着看.柯朗的书的习题与陶 ...

  6. Zabbix实战-简易教程--日志类

    一.主动模式和被动模式介绍 要监控日志,必须使用主动模式,那么,什么是主动模式?什么是被动模式呢? 1.主动模式和被动模式 主动模式 主动模式通讯过程: ● Agent打开TCP连接(主动检测变成Ag ...

  7. 六种流行的语言大餐---C、C++、python、Java、php、C#你更喜欢哪一个呢?

    引言 鉴于五一期间超大的人流量,LZ思来想去,最终还是选择蜗居在自己的出租屋.无聊之际,当然不能忘了做点什么事情,于是LZ就研究了一下几种语言的皮毛,在这里献丑一翻,希望各位猿友莫要见笑. 不过说来也 ...

  8. 《杜增强讲Unity之Tanks坦克大战》5-子弹

    5 子弹 本节的任务是创建子弹的Prefab   image 首先从Model/Shell找到子弹的模型,拖入Hierarchy中,添加刚体组件,所有属性默认值. 添加Capsule Collider ...

  9. golang安装开发环境配置

    本机系统:fedora28 step 1 百度搜索 golang 到 go 语言中文网,下载 golang 包,如果是 linux 系统可以直接点击此连接,也可去 go 语言中文网, https:// ...

  10. oracle数据库之rownum和rowid用法

    Rownum 和 Rowid是Oracle数据库所特有的,通过他们可以查询到指定行数范围内的数据记录.   以下通过例子讲解: -- 为了方便,首先,查找dept表中的所有. select deptn ...