RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSession.KeepConnections Property

Specifies whether or not a temporary database component created in the context of a session maintains a database server connection even if there are no active datasets associated with the database component.

Pascal
property KeepConnections: Boolean;
C++
__property Boolean KeepConnections;

Use KeepConnections to specify whether or not temporary database components created at runtime maintain server connections even when they have no active datasets. If KeepConnections is true (the default), the application maintains database connections until the application exits or calls the DropConnections method. For connections to remote database servers, or for applications that frequently open and close datasets, KeepConnections should remain true to reduce network traffic and speed up processing. 

When KeepConnections is false, an application disconnects from a database when all datasets associated with a database component are closed. Dropping a connection releases system resources allocated to the connection, but if a dataset is later reopened that uses the same database, the connection must be reestablished and initialized.

Note: Duration of server connection for a persistent database component is determined by the database component's KeepConnection property instead of the session's KeepConnections property.
 

 

DropConnections 

TDatabase 

KeepConnection 

Understanding Database and Session Component Interactions 

Specifying Default Database Connection Behavior

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