You can trace usage of a Turnkey application with the SysTurnkeyTrace model pattern.
Use SysTurnkeyTrace for Turnkey usage tracing
SysTurnkeyTrace, also called TraceLog or user audit, is a model pattern for catching usage of the Turnkey application. When the pattern is discovered, all actions and navigations are tracked.
On specific intervals, the trace is spooled to the database as SysTurnkeyTrace objects.
Add the pattern to your model
The SysTurnkeyTrace pattern is available on GitHub and can be merged into a model from the LiveEdit AssetsTK tab.
After the pattern is discovered, actions and navigations are tracked for the Turnkey application.
Persistence limitation
There is a risk that the current trace batch is lost if the server goes down. Otherwise, the documentation states that all trace is caught.
SQL Server change tracking has a different purpose
SQL Server change tracking is documented for detecting changes made by another client or service directly to the SQL database. MDrivenServer has its own dirty list, but it does not learn about direct changes to underlying SQL Server tables made by another client or service.
With SQL Server change tracking enabled, MDriven can first check whether any change has occurred and then iterate change information for the tables of interest. The implementation uses the changed-row information to call SuspectExternalUpdateInvalidate, making affected objects dirty. When dirty objects are currently shown in a user interface, they are reloaded from MDrivenServer/SQL Server.
The source recommends enabling change tracking on the database and on tables that can be affected by a non-MDriven system, rather than on all tables.
Choose the mechanism
| Need | Mechanism | Documented result |
|---|---|---|
| Track Turnkey application actions and navigations | SysTurnkeyTrace | Actions and navigations are tracked; trace is periodically spooled to the database as SysTurnkeyTrace objects.
|
| Detect external changes to SQL-backed data and refresh affected displayed objects | SQL Server change tracking with MDriven invalidation handling | Affected objects are made dirty and, if currently shown in a user interface, reloaded from MDrivenServer/SQL Server. |
