Describes how to use AnyDAC offline mode allows to work with data without a persistent connection to a database.
The AnyDAC offline mode is similar to a multi-tier client, where most of time a client is disconnected from a database. The connection is active only when a client needs to exchange data with a database. That is useful when an application works in an unstable environment or requires to preserve the DBMS resources.
In offline mode a connection to a database is closed. But the datasets are opened.
To bring a connection to offline mode use one of the options:
AnyDAC does not allow to bring a connection to the offline mode automatically, as it does not know when the next time an application needs to contact a database. So, that must be done by the application code. Before the connection will be set to the offline mode, active datasets with not yet fetched result sets will perform an action specified by the FetchOptions.AutoFetchAll property.
To bring a connection to online mode use one of the following options:
If a dataset has ResourceOptions.PersistentFileName property specified, then at Open call, the connection is not required for the dataset. It will load the content from the specified file.
Note, bringing connection to offline and then to online mode is similar to recovering a broken connection in aspect that a database session state is lost. Read Recovering Connection article for more details.
What do you think about this topic? Send feedback!