Working with object locking
Object locking provides a way to prevent conflicts and overwriting of changes when developing websites in a multi-user environment. Overwriting can occur when multiple users work on a single instance of Kentico or when multiple development instances are connected to a shared database. Locking ensures that only a single user (or multiple people signed in under the same user account) can modify a specific object at a time. Users can lock objects for editing (check out) and unlock them (check in) after finishing.
The following table lists the objects types that support object locking. The Editing interface column shows the locations within the Kentico administration interface where you can edit objects of the given type.
Object type |
Editing interface |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Enabling object locking
Object locking is disabled by default. To enable the feature:
- Open the Settings application.
- Select the Versioning & Synchronization -> Object versioning category.
- Enable Use check-in/check-out for objects.
- Click Save.
The setting applies globally and cannot be changed for individual sites.
Tip: If your environment consists of multiple development instances with a shared database, we strongly recommend setting up web farm synchronization. Web farms ensure that all instances are always up-to-date by synchronizing cached content and settings.
Editing objects with locking
With locking enabled, you cannot edit objects directly. If nobody else is currently editing a given object, click Check out to enable editing and lock the object.
Once you have an object checked out, you can make any required changes.
- Click Save to save changes and update the system (other users can view your changes).
- Clicking Undo checkout has the following effect:
- if object versioning is ON: cancels the checkout and discards all changes made to the object (even changes confirmed via the Save button). Unlocks the object for other users.
- if object versioning is OFF: discards changes made to the object since the last Save and unlocks the object for other users.
- Click Check in to save changes and unlock the object for other users.
You can have any number of objects checked out and there is no time limit.
If another user has an object checked out, the object is read-only. You cannot make any changes or check out the object yourself.
Global administrators can undo the checkout of any object
Users with the Global administrator privilege level can perform Undo checkout on any checked out object in the system.
Object versioning with locking
Every time you click Save or Check in, the system creates a new version of the object according to the rules described in Using object versioning. You can view the versions on the object’s Versions tab.
If you click Undo checkout, the versions created by the Save action are discarded. The last version before the checkout is then set as the current version.
Typical scenarios
You want to edit an object:
- Open the object’s editing interface (for example CSS stylesheets -> Edit () Corporate Site).
- Click Check out.
- The object is locked for other users. Only you can edit an object.
- Edit the object.
- You can save your work using the Save button.
- Click Check in.
- The system confirms your modifications and unlocks the object.
You want to create a new object:
- Click New <object> in the given section of the administration interface.
- The system displays the new object’s dialog with only the Save button available.
- Type in the object’s name and all the required details.
- Click Save.
- The system saves your new object.
- The status of the new object depends on the Settings -> Versioning & Synchronization -> Object versioning -> Keep new objects checked out setting.
You need to edit an object, that is currently checked out by another user:
You have several options:
- wait until the user checks the object back in. You may need to refresh the page to see if the object is checked-in
- contact the user
- ask a global administrator to perform Undo checkout
Viewing checked-out objects
To view a list of all objects that you have checked-out:
- Open the Checked-out items application.
- Select the Objects tab.