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
相关文档:
一、在Delphi7中连接MS SQL Server 2000的方法。
刚开始时界面如下:添加4个控件。
设置控件属性过程:
1、ADOConnection1设置
1)双击ADOConnection1,进行设置连接字符串(作用是:选取连接驱动方式和连接的数据库设置)。过程如下图所示:
2、ADOQuery1设置:
1)ADOQuery1.connection属性为ADOConnection1; ......
@符号返回一个变量的地址
例:
var
f:string;
p:^string; //声明一个字符串类型的指针
begin
f ='demo'; ......
格式:操作数 Shl/Shr 移动位数
说明:操作数与返回值都是整数
例子:16(10) = 10000(2)
16(10) Shr 1 = 10000(2) Shr 1 = 1000(2) = 8(10)
16(10) Shr 2 = 10000(2) Shr 2 = 100(2) = 4(10)
说明:一个整数(I)按位左移一位,相当于把它乘以2,即 I * 2
&n ......
procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked then
SetWindowPos(Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE)
else
SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE);
end;//使用Self.FormStyle := fsStayOnTop;会使界 ......
以前看了 通过崩溃地址找错误行数之VC版 那时候还没用DELPHI
昨晚刚好又看到了 所以就试了一下DELPHI的,与大家共享 ^_^
什么是 MAP 文件?简单地讲, MAP 文件是程序的全局符号、源文件和代码行号信息的唯一的文本表示方法,它可以在任何地方、任何时候使用,不需要有额外的程序进行支持。而且,这是唯一能找出程 ......