Pessimistic Locking & Deleting


We are currently exploring pessimistic locking and it is working great for simultaneous users trying to edit the same entity. However I would have expected the pessimistic lock to also prevent a user from deleting a record if another user is editing it. Is this correct or are we doing something wrong as this is causing access denied errors.

User 1 is in edit mode:

User 2 selects the same record and clicks remove:

User 2 remove is successful despite user 1 being in edit mode:

User 1 tries to save entity and receives access denied:


Hi David,

Currently, the locking information is only analyzed inside entity editors, not in RemoveActions of browse screens. You may search for usages and see how it works.

If necessary, you can easily modify remove actions in order to check whether the entity instance is locked.

It may be something like this:

public class OrderBrowse extends StandardLookup<Order> {

    private RemoveAction<Order> ordersTableRemove;

    private GroupTable<Order> ordersTable;

    private LockService lockService;
    private Notifications notifications;

    public void onOrdersTableRemove(Action.ActionPerformedEvent event) {
        Order order = ordersTable.getSingleSelected();
        LockInfo lockInfo = lockService.getLockInfo(order.getMetaClass().getName(), order.getId().toString());
        if (lockInfo != null) {
                    .withCaption("The order is locked by other user")
        } else {

That works. Thanks Maxim. :+1: