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) 创建数据表的时候 ...
随机推荐
- 《Java 程序设计》课堂实践项目汇总链接
1.<Java 程序设计>课堂实践项目-命令行参数 2.<Java 程序设计>课堂实践项目-mini dc 3.<Java 程序设计>课堂实践项目-Arrays和S ...
- Linux下开发python django程序(设置admin后台管理上传文件和前台上传文件保存数据库)
1.项目创建相关工作参考前面 2.在models.py文件中定义数据库结构 import django.db import modelsclass RegisterUser(models.Model) ...
- [Deep-Learning-with-Python]神经网络的数学基础
理解深度学习需要熟悉一些简单的数学概念:Tensors(张量).Tensor operations 张量操作.differentiation微分.gradient descent 梯度下降等等. &q ...
- Java 原生日志 java.util.logging
简介 Java 中的 Logging API 让 Java 应用可以记录不同级别的信息,它在debug过程中非常有用,如果系统因为各种各样的原因而崩溃,崩溃原因可以在日志中清晰地追溯,下面让我们来看看 ...
- Python之元类详细解析
一.补充内置函数isinstance和issubclass 1.isinstance是判断一个对象是不是由一个对象产生的 class Foo: pass obj=Foo() print(isinsta ...
- SSIS 处理错误的方法
Package在执行过程中,不可避免地会发生错误,如果处理错误?简单粗暴的做法,是Package直接停止运行.对于一个成熟的ETL工具,这显然不是唯一的错误处理方法.如果在数据流中出现错误,那么数据流 ...
- 巧用 Python 找工作(资料在文末)
前言 近年来 Python 之火大家都有感而知,那亲们知道北京的 Python 开发岗位.运维开发岗位招聘地域都是如何分布的吗?薪水如何?是否有前景等等,这些数据呢直接通过招聘信息来了解到企业用人是最 ...
- UWP 卡片视图 Card View
上一篇 提到了 UWP 轨道视图Orbit View,这次就说一下卡片视图,毕竟两个差不多. 卡片视图,效果如其名,卡片一样,左右滑动,当然能翻牌最好了. 嗯,我这个可以的额(⊙﹏⊙)... 看下效果 ...
- Java实现Oracle的to_char函数
/** * 将int.long.double.float.String.Date等类型format成字符类型 * * 一.数字format格式处理: * 01)99.99的实现,小数位四舍五入不够位数 ...
- Linux入门基础(二):Linux磁盘及文件管理系统
磁盘管理 fdisk分区工具 只支持MBR分区 fdisk命令只有root用户能用 fdisk -l 列出所有安装磁盘及分区信息 fdisk /dev/sda (操作磁盘,按m可列出帮助界面,常用的操 ...