Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When a user types a value into a text field (which is bound to a specific column of the database table) and clicks out, the Servoy Application Server issues a SQL update command to the database to modify the selected record. The resulting change is also broadcast|display/DOCS/Data+Broadcasting|||||||||||||||||||||||\ to all connected clients.

...

The fundamental unit of data binding in both the GUI and the API is the Servoy Foundset|display/DOCS/Foundsets+Concepts|||||||||||||||||||||||\ object.

...

If a data change originates from another application, client caches may become "stale" for the affected records, meaning that the cached values are not in sync with the last values stored to the database. This is most likely to happen if an existing record has already been cached prior to being updated by another application. It may also happen if records are added or deleted. However, the duration of the problem will be shorter for inserts and deletes than for updates. This is because while foundsets may reload primary keys periodically as the user navigates the client session, the contents of a record can remain cached indefinitely.

How can a "stale" cache be updated?

There are several approaches to updating a stale cacheFortunately, Servoy's APIs provides several opportunities to programmatically update client caches. The best approach depends on the situation.Also, Servoy's API provides a means to programmatically update client caches in cases where a record is modified outside of any Servoy Client session, i.e. from another application.

Flush All Client Caches

This approach will re-cache all records in all client caches for a specified database table. All foundsets based on the specified table will reissue their queries and all cached records will be refreshed from the database. This approach is the most comprehensive and therefore, most expensive in terms of performance. This approach is ideal to use when:

  • External changes were made using the Raw SQL Plugin to update a specific database table. Although, initiated from Servoy client session, this plugin bypasses the Data Binding layer and will not be reflected in the client cache.
  • External changes are known to have been made on a specified table because a 3rd-party application or service was invoked from Servoy client session.
  • External changes may have been made to a specific table by another application. In this situation it may be ideal to periodically update the client caches using a Batch Processor, which is a server-side client session that can perform automated, scheduled operations.

Notify Data Change

Refresh Record From Database

Data Transactions in Servoy

...