Local Databases (Magic xpa 4.x)
Local databases can be used to store and access data locally on RIA clients. Using this database, you can define local data sources, which let you save data on the client and use it later on, mainly in Offline programs that do not access the server. Local Databases cannot be used in Web Client tasks.
Using local storage can also improve performance by locally caching data.
The following information is about working with the local database:
Direct SQL
|
A Local database cannot be used in a Direct SQL statement.
|
Transactions
|
The transaction for local data sources behaves as a physical transaction. All the tasks that include a local data source will be in the same transaction. (This is planned to be changed in future versions.)
|
Commit
|
Commit of the local data is done according to the task that opened the transaction. If a transaction is also opened in sibling tasks, then the data of these tasks will also be committed. (This is planned to be changed in future versions.)
|
Roll back
|
Rolling back a task that has a local data source will roll back:
|
Encryption
|
The Local database supports encryption (Since version: 3.0 on Android and iOS and Since version: 3.1 on Windows desktop).
The encryption password is defined in the User Password database property.
It is not possible to migrate an existing non-encrypted Local database to an encrypted database. If you have an existing application with a Local database and you want to use encryption, you should define a different database with encryption and synchronize your data to this database.
|
|
-
On Android devices, a Local database is limited to one 1MB per record.
-
Storing large data as Blobs in a record is not recommended and should be avoided. Large data should be stored in separate files and transferred from and to the server using the ClientFileToServer and ServerFileToClient functions. Refer also to: Sending Large Data to the Client.
|
Since version: 2.4
Local (Offline) Storage