Bde.DBTables.TSession.AutoSessionName

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property AutoSessionName: Boolean read FAutoSessionName write SetAutoSessionName default False;

C++

__property bool AutoSessionName = {read=FAutoSessionName, write=SetAutoSessionName, default=0};

Properties

Type Visibility Source Unit Parent
property published
Bde.DBTables.pas
Bde.DBTables.hpp
Bde.DBTables TSession

Description

Indicates whether or not a unique session name is automatically generated for a session.

Set AutoSessionName to control whether or not a unique session name is automatically generated. AutoSessionName is intended to guarantee developers of multi-threaded applications that sessions spawned for each thread are unique at runtime.

When AutoSessionName is false (the default), the application must set the SessionName property for a session component. When AutoSessionName is true, TSession assigns the SessionName property automatically and replicates the session name across the SessionName properties of all dataset components in the data module or form where the session component appears. This allows applications to use sessions in data modules that are replicated over multiple threads. TSession constructs a session name by taking the current value of the Name property and appending an underscore (_) followed by a numeric value. For example, if Name is CustomerSession, then the AutoSessionName might be CustomerSession_2.

Note: The following restrictions apply to AutoSessionName:

  • You cannot set AutoSessionName for a session in a data module or form that contains more than one session component.
  • You cannot add a session component to a data module or form that already contains a session component with AutoSessionName set to true.
  • You cannot directly set the SessionName property of a session when AutoSessionName is true.

See Also