Skip to content

Commit 92b0f95

Browse files
authored
Merge pull request #11218 from mendix/ctl-offline-optimistic-locking-1111
Optimistic Locking in Offline Apps
2 parents ac872bc + 103d954 commit 92b0f95

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

content/en/docs/refguide/runtime/optimistic-locking.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,25 @@ If a conflict is detected—meaning someone else has modified the data since you
1717

1818
You can decide whether optimistic locking is enabled or disabled for your app.
1919

20-
## Behavior of App with Optimistic Locking Disabled
20+
### Support Status by App Type
21+
22+
Optimistic locking is supported in the following types of Mendix apps:
23+
24+
* Online apps: supported since [Studio Pro 11.5](/releasenotes/studio-pro/11.5/)
25+
* Offline apps: supported since [Studio Pro 11.11](/releasenotes/studio-pro/11.11/)
26+
* **Additional Information on Optimistic Locking in Offline Apps** — As data can live for a long time in offline apps, changes based on that data that are synchronized from offline apps to the Mendix Runtime Server are committed to the database without optimistic locking to avoid conflicts. As such, offline data synchronization may overwrite changes.
27+
28+
## App Behavior: Optimistic Locking Disabled
2129

2230
When two modifications are saved, they are applied in the order of processing. Only changed attributes are written to the database. This means that if the two commits change different attributes or associations of an object, the changes are not overwritten.
2331

2432
For example, if one user commits changes for `AttributeA` and `AttributeB` and another user commits changes for `AttributeB` and `AttributeC` for the same object, then both `AttributeA` and `AttributeC` are committed according to both users' changes. `AttributeB` is committed based on whichever change was committed later.
2533

26-
## Behavior of App with Optimistic Locking Enabled
34+
## App Behavior: Optimistic Locking Enabled
2735

2836
The Mendix runtime implements optimistic locking by tracking the version of all objects using the attribute `MxObjectVersion` with type `Long`. Although the `MxObjectVersion` attribute is not write-protected, setting this value does not result in it being saved to the database. Its current value is compared with the value for the same object in the database.
2937

30-
### How to Enable and Use Optimistic Locking
38+
### Enabling and Using Optimistic Locking
3139

3240
You can enable optimistic locking for your Mendix application in the `Runtime` tab in the **App Settings** dialog:
3341

0 commit comments

Comments
 (0)