Class DacSession() Professional
Class function of the DacSession class.
The DacSession class is used for session management. In addition to establishing and closing down connections to a server, the class also offers functionality to invoke a transaction processing system, if supported by the server.
The successful connection to a server marks the beginning of a session, which ends when the client application disconnects. While the session is open, all database operations triggered by database functions and commands such as USE database or DbCreate() are forwarded to the server by a DacSession object. The database operations are then performed by the server rather than by the client application. A DacSession object in turn receives the response from the server and returns it to the client application. This way, data sources residing on a server can be accessed as if they were stored on the computer running the application (client station).
An application may create multiple DacSession objects, and each object can handle a connection to a different server. In this case, the default session becomes important. Many functions and commands of the Xbase++ language do not allow to specify the server which is to perform a certain database operation. When the client application executes such a function or command, it is the DacSession object defined as the default session which accepts the request and forwards it to the server it is connected to. Also see the methods :setDefault() and :getDefault() for further information.
The default session has thread-local scope. This means that each thread in a multi-threaded program may have a different DacSession object defined as the default session. As a result, the database operations corresponding to a DbCreate() function call for example, could be performed by different servers if DbCreate() is used in threads with a different default session set.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.