• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

[ADO]如何修改ADO的线程模型

发布: 2007-7-01 20:40 | 作者: admin | 来源: | 查看: 15次 | 进入软件测试论坛讨论

领测软件测试网 ADO缺省情况下当然是Apartment线程模型。  If you are using this in IIS and ADO is only being used at page scope then it should be fine. If you are using it at the session or application level then you will need to mark it as both. 

 

那么怎么改为Both呢?

可能就是改一下注册表里面的线程模型。

 

C:\Program Files\Common Files\System\ado

文件夹下,有两个reg文件,很有趣,可能就是这个意思。

ADOFRE15.REG

ADOAPT15.REG

 

其中,ADOFRE15.REG就是这个内容:

REGEDIT4

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000507-0000-0010-8000-00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000514-0000-0010-8000-00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{0000050B-0000-0010-8000-00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000535-0000-0010-8000-00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"

 

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{00000541-0000-0010-8000-00AA006D2EA4}\InprocServer32]
"ThreadingModel"="Both"

 

okay, you´ll see that the ThreadingModel is adjusted for the following coclasses: 1. Command2. Connection3. Parameter4. Recordset5. Error If the threading model selected is "Apartment" (the default), then theobjects listed above can be accessed only by the thread created it.  Ifthreading model is "Both" and the object is created in an STA, then allaccess to it will through the single thread that runs in the STA. Ifthreading model is "Both" and the object is created in an MTA, then anythread in this MTA will have direct access to it. If the objects integrate FTM (I don´t know whether ADO does this or not),then different threads in different apartments will have direct access tothe objects (without proxies).
或者参见权威的微软文档:

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网