RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
DataBkr.RegisterPooled Function

Registers a remote data module so that instances are pooled.

Pascal
procedure RegisterPooled(const ClassID: string; Max: Integer; Timeout: Integer; Singleton: Boolean = False);
C++
RegisterPooled(const AnsiString ClassID, int Max, int Timeout, Boolean Singleton = False);

DataBkr

In Delphi applications, to enable remote data module instances to be pooled, call RegisterPooled from the UpdateRegistry method of a remote data module class. When data module instances are pooled, the server maintains a cache of remote data module instances. Each client request is serviced by the first available instance from that cache. Because instances are shared, the remote data module can't rely on persistent state information. 

ClassID is the class ID of the remote data module. This value is passed as a parameter to the UpdateRegistry method that calls RegisterPooled. 

Max indicates the maximum number of instances in the pool. If client applications request more than this maximum number, the application server raises a "Server too busy" exception. 

Timeout indicates the number of minutes a remote data module instance can sit idle in the object pool. If an instance receives no client requests for more than Timeout minutes, it is automatically freed. The server checks every 6 minutes, so an object may persist in an idle state up to 6 minutes longer than Timeout. Setting Timeout to 0 indicates an infinite timeout period (that is, unused objects are not freed until the application server shuts down). 

Singleton indicates that all client calls go to the same remote data module instance. There is only a single instance rather than a pool of available instances. Only set Singleton to true if the remote data module is free-threaded.

Note: When Singleton is true, the values of Max and Timeout are ignored because there is only one instance with no timeout period.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!