Icon AutoSessionName Property

property AutoSessionName: Boolean


Use the AutoSessionName property to specify whether or not a unique session name is automatically generated for the TDBISAMSession component. AutoSessionName is intended to guarantee developers of multi-threaded applications that TDBISAMSession components created for each thread are assigned unique names at runtime.

When AutoSessionName is False (the default), the application must set the SessionName property for a session component to a unique name within the context of the application. When AutoSessionName is True, the TDBISAMSession component assigns the SessionName property automatically and replicates this session name across the SessionName properties of all TDBISAMDatabase, TDBISAMQuery, and TDBISAMTable components in the data module or form where the session component is created. This allows applications to use TDBISAMSession components in data modules that are replicated over multiple threads without having to worry about providing unique names for each session when the data module is created. The TDBISAMSession component 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 the Name property was set to "CustomerSession", then the AutoSessionName property would be set to "CustomerSession_2" for the second session created.

Information The following restrictions apply to the AutoSessionName property:

   You cannot set the AutoSessionName property to True for a TDBISAMSession component in a data module or form that contains more than one TDBISAMSession component.

   You cannot add a TDBISAMSession component to a data module or form that already contains a TDBISAMSession component with its AutoSessionName property set to True.

   You cannot directly set the SessionName property of a TDBISAMSession component when its AutoSessionName property is True.