Skip to content

Cache is not cleared after deletion of process definition #4039

@despoina-kaz

Description

@despoina-kaz

Describe the bug
In my app I use repository service to get all versions of a process definitions and I delete all of them (with cascade false).
When I try to get all the instances (including the ones that are related with a deleted process definition), I make a first call to get the process definition and a second call to get the identity links of the process definition. The first call returns the process definition (although is deleted) but the second one throws exception that it doesn't find it (which is the correct behavior).

Expected behavior
The repositoryService.getProcessDefinition should throw FlowableObjectNotFoundException.

Code
processDefinition = repositoryService.getProcessDefinition(workflowDefinitionId); List<IdentityLink> candidates = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());

Additional context
Flowable version: 7.1.0
Spring boot

Additional comments
It seems that the repositoryService.getProcessDefinition uses cache so I suppose that it fetches the process definition from here while repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId()); searches at the database. Why the cache is not cleared after deleting the process definition? The strange this is that it works sometimes and some other times it doesn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions