RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSession Class

TSession provides global management of a group of database connections in an application.

Pascal
TSession = class(TComponent, IDBSession);
C++
class TSession : public TComponent, public IDBSession;

DBTables

Use TSession to manage a group of database connections within an application. There are three uses for TSession: standard, multiple net files for Paradox, and multi-threaded database applications. 

The library automatically creates a globally accessible default TSession component named Session for all database applications. The default session component handles standard database connections. An application can control the default session by accessing its properties, events, and methods at runtime. 

Database applications that must simultaneously access Paradox tables located in different network locations can establish multiple sessions, one for each network location. 

Finally, database applications that must establish multiple, concurrent connections to the same database, such as performing two queries against the same data at once, are multi-threaded applications. Multi-threaded applications must create and maintain one additional session component for each simultaneous connection to a single database server.

Note: Applications that maintain multiple sessions can manage them through the TSessionList component. A default session list component, called Sessions—note the plural which distinguishes it from the default session component, Session—is automatically created for all database applications.
Note: TSession implements the IDBSession interface, which allows the global PasswordDialog function to supply passwords to the component.
 

 

TDatabase 

TSessionList 

Session 

Sessions 

IDBSession 

PasswordDialog 

Associating a Database Component with a Session 

Understanding Database and Session Component Interactions

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