flowable/flowable-engine · error · FlowableObjectNotFoundException

Lock with name ${lockName} does not exist

Error message

Lock with name ${lockName} does not exist

What it means

ReleaseLockCmd deletes the lock row identified by lockName from the Flowable property table. If no property entity with that name exists (the lock is not held or was already released/expired), it throws FlowableObjectNotFoundException. This indicates the caller tried to release a lock the engine has no record of.

Source

Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/cmd/ReleaseLockCmd.java:47

    public ReleaseLockCmd(String lockName, String engineType, boolean delete) {
        this.lockName = lockName;
        this.engineType = engineType;
        this.delete = delete;
    }

    @Override
    public Void execute(CommandContext commandContext) {
        PropertyEntityManager propertyEntityManager = commandContext.getEngineConfigurations().get(engineType).getPropertyEntityManager();
        PropertyEntity property = propertyEntityManager.findById(lockName);
        if (property != null) {
            property.setValue(null);
            if (delete) {
                propertyEntityManager.delete(property);
            }
            return null;
        } else {
            throw new FlowableObjectNotFoundException("Lock with name " + lockName + " does not exist");
        }
    }
}

View on GitHub (pinned to d6d39ce1c6)

Solutions

  1. Verify the lock name matches exactly the one used with AcquireLockCmd (case and spelling).
  2. Wrap the release in a check or catch FlowableObjectNotFoundException and treat a missing lock as already released.
  3. Inspect the property table (e.g. ACT_GE_PROPERTY) to confirm the lock row exists before releasing.

Example fix

// before
managementService.executeCommand(new ReleaseLockCmd("async-executor-lock", true));
// after
try {
    managementService.executeCommand(new ReleaseLockCmd("async-executor-lock", true));
} catch (FlowableObjectNotFoundException e) {
    // lock no longer exists; nothing to release
}
Defensive patterns

Strategy: try-catch

Validate before calling

PropertyEntity lock = commandContext.getPropertyEntityManager().findById(lockName); if (lock != null) { /* safe to release */ }

Try / catch

try { managementService.executeCommand(new ReleaseLockCmd(lockName, true)); } catch (FlowableObjectNotFoundException e) { log.info("Lock {} already gone; treating as released", lockName); }

Prevention

When it happens

Trigger: Calling managementService.executeCommand(new ReleaseLockCmd(lockName, changeLogDelete)) when the lock name does not match any row in the property table — e.g. acquiring after the lock already expired, double release, or a typo in the lock name.

Common situations: Async executor lock management after a database was wiped or migrated; race conditions where two nodes attempt release; upgrading engine versions where lock property names changed; custom code releasing locks it never acquired.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of flowable/flowable-engine@d6d39ce1c6 (2026-09-11). Data as JSON: /api/errors/2795e7af0c32590f. Report an issue: GitHub.