易截截图软件、单文件、免安装、纯绿色、仅160KB

Using COM+ object pooling with Delphi 6

 URL: http://edn.embarcadero.com/article/27568
Abstract: Delphi 6 introduces support for COM+ object pooling, which can provide significant performance improvements under some circumstances. We take a look at Delphi 6s object pooling support. By Vincent Parrett.
Typically, when a client application instantiates a COM+ object, the COM+ runtime will create a new instance of the object. When your client is done with the object, COM+ will destroy the object. This all makes for very efficient use of memory resources, and under normal loads provides quite an acceptable performance.
However, under higher loads the creation and destruction of objects can become a substantial overhead. This is especially true if your COM+ objects are themselves allocating resources, instantiating other objects, and so on.
Object pooling can help in these situations by reducing the number of times an object must be instantiated or destroyed. When pooling is in effect, a client's request for an object will kick of a search to see if there is a ready-to-use object pool for objects of the appropriate type. If so, the COM+ system will provide and activate the object. If not, COM+ will create a new object. When the client is done with the object, COM+ will not destroy the object, but will return it to the object pool so it can be reused.
To get the best out of COM+, your objects should be stateless. To make use of object pooling, they must be stateless objects.
Object pooling with Delphi 6
Supporting object pooling in Delphi 6-generated COM+ objects is simple, however there are a few things that you need to take care with:
Threading model
The first is that you must select the Both threading model, otherwise object pooling will be disabled.
If you get this wrong, don't worry -- it's easy to fix. The New Transactional Object wizard generates code that looks something like this :
initialization
TAutoObjectFactory.Create(ComServer, TMyCOMPlusObject, Class_MyCOMPlusObject,
ci


相关文档:

DB2 和 Delphi 7 — SOAP 和数据库 Web 服务

 构建 Windows SOAP 服务器应用程序
首先在 Windows 上构建服务器,然后在 Linux 上构建客户机。(如果需要,可以使用其它方法 — 或者将它们全部构建在 Windows 或 Linux 上。)对于 Windows SOAP 服务器,启动 Delphi 7 Enterprise,执行 File -> New -> Other,转至对象资源库(Object Repository)的 ......

用PLSQL自动生成数据库表的Delphi对象

 DECLARE
  TYPE TY_QUECUR IS REF CURSOR;
  CUR_COLUMNS  TY_QUECUR;
  SQLCMD  VARCHAR(500);
  TABNAME VARCHAR(20);
  COLNAME VARCHAR(50);
  COLTYPE VARCHAR(20);
  COLCOMMENT VARCHAR2(50);
  COLLENGTH INTEGER;
  COLPRECISION INTEGER; ......

delphi获得网卡的MAC地址


 
获得网卡的MAC地址在很多地方都有很大的用处,下面的函数以XX-XX-XX-XX-XX-XX 的格式返回远程或本地机器的MAC地址。
Function to return the MAC address of a remote or local machine in the format XX-XX-XX-XX-XX-XX
返回的MAC地址是一个能用在多个方面的唯一标识。使用方法:
ShowMessage(GetMacAddress( ......

简单的Delphi三层程序开发

 一年前开发了一个MIDAS的程序,最近修改服务端,可是这个服务无法注册,最后终于找到了解决办法,这个相关文章如下:(算是备份吧)
(一)MIDAS是什么?
Delphi中MIDAS到底是什么呢?和他相关组件是什么呢? 
MIDAS(Multitiered Distributed Application Services)多层分布式应用服务。
   Delphi所提出 ......

终于搞定了Delphi的Unicode支持(Tnt控件)

原来是要在FormCreate中加入以下代码:
procedure TTntForm1.TntFormCreate(Sender: TObject);
begin
  //这句很关键.对于平台的支持.
  if Win32Platform = VER_PLATFORM_WIN32_NT then
    Font.Name := 'MS Shell Dlg 2'
  else
    Font.Name := 'MS Shell Dlg';
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号