Datasnap.DataBkr.RegisterPooled

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure RegisterPooled(const ClassID: string; Max, Timeout: Integer; Singleton: Boolean = False);

C++

extern DELPHI_PACKAGE void __fastcall RegisterPooled(const System::UnicodeString ClassID, int Max, int Timeout, bool Singleton = false);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Datasnap.DataBkr.pas
Datasnap.DataBkr.hpp
Datasnap.DataBkr Datasnap.DataBkr

Description

Registers a remote data module so that instances are pooled.

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 cannot 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.

See Also