{"record":{"id":"4f50e6387e54e59e","repo":"flowable/flowable-engine","slug":"retries-failed-with-flowableoptimisticlockingexce","errorCode":null,"errorMessage":" retries failed with FlowableOptimisticLockingException. Giving up.","messagePattern":" retries failed with FlowableOptimisticLockingException\\. Giving up\\.","errorType":"exception","errorClass":"FlowableException","httpStatus":null,"severity":"error","filePath":"modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/RetryInterceptor.java","lineNumber":57,"sourceCode":"            if (failedAttempts > 0) {\n                LOGGER.info(\"Waiting for {}ms before retrying the command.\", waitTime);\n                waitBeforeRetry(waitTime);\n                waitTime *= waitIncreaseFactor;\n            }\n\n            try {\n\n                // try to execute the command\n                return next.execute(config, command, commandExecutor);\n\n            } catch (FlowableOptimisticLockingException e) {\n                LOGGER.info(\"Caught optimistic locking exception: {}\", e.getMessage(), e);\n            }\n\n            failedAttempts++;\n        } while (failedAttempts <= numOfRetries);\n\n        throw new FlowableException(numOfRetries + \" retries failed with FlowableOptimisticLockingException. Giving up.\");\n    }\n\n    protected void waitBeforeRetry(long waitTime) {\n        try {\n            Thread.sleep(waitTime);\n        } catch (InterruptedException e) {\n            LOGGER.debug(\"I am interrupted while waiting for a retry.\");\n        }\n    }\n\n    public void setNumOfRetries(int numOfRetries) {\n        this.numOfRetries = numOfRetries;\n    }\n\n    public void setWaitIncreaseFactor(int waitIncreaseFactor) {\n        this.waitIncreaseFactor = waitIncreaseFactor;\n    }\n","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/RetryInterceptor.java#L39-L75","documentation":"Retry-exhaustion signal from RetryInterceptor.execute: the command was retried the configured number of times after FlowableOptimisticLockingException but kept failing on concurrent updates; the interceptor gives up and reports the number of attempts.","triggerScenarios":"Thrown at modules/flowable-engine-common/src/main/java/org/flowable/common/engine/impl/interceptor/RetryInterceptor.java:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce concurrent writers on the same rows (fewer parallel workers on one entity)","Increase retry count / wait time on the RetryInterceptor configuration","Move long-running state mutations off hot entities to lower lock contention"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}