From RAD Studio API Documentation
Jump to: navigation, search


property   DataContext: TDataContext read FDataContext write SetDataContext;


__property TDataContext* DataContext = {read=FDataContext, write=SetDataContext};


Type Visibility Source Unit Parent
property public
Soap.InvokeRegistry TRemotable


Specifies the object that controls the lifetime of a TRemotable instance.

By default, when a Web Service application creates an instance of a remotable object, that object exists only for the time it takes to marshal the information it represents or to unmarshal that information into the TRemotable instance and then make a method call that uses the instance. The object specified by DataContext handles the freeing of the TRemotable instance.

There are times when a server may not want the TRemotable instance to be so transient. For example, if the object contains state information, it may be more efficient to have a single instance that is used for every message call. If you change DataContext, the TRemotable instance is removed from the data context, and is not freed when the data context goes away at the end of the method call.

Note: If DataContext is nil (Delphi) or NULL (C++), the application is responsible for freeing the TRemotable instance. For example, TRemotable objects created on client applications are created with a nil (Delphi) or NULL (C++) value for DataContext and must be freed by the client application.

See Also