Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep cache of instances possibly referencing updated entity #92

Open
ledsoft opened this issue Sep 4, 2021 · 0 comments
Open

Sweep cache of instances possibly referencing updated entity #92

ledsoft opened this issue Sep 4, 2021 · 0 comments

Comments

@ledsoft
Copy link
Contributor

ledsoft commented Sep 4, 2021

When an entity is updated (merged into the persistence context) and the transaction is committed, the second level cache updates only the updated entity itself.
However, there may be other entities referencing (possibly indirectly) the updated entity. These should be evicted as well.

Consider the following example:

@OWLClass(iri = '...')
class Report {

@OWLObjectProperty (iri = '...')
private Audit audit;
}

@OWLClass(iri = '...')
class Audit {

@OWLObjectProperty (iri = '...')
private Set<AuditFinding> findings;
}

@OWLClass(iri = '...')
class AuditFinding {
}

Now, if a Report of an audit with some findings is loaded into the cache and then a particular AuditFinding is updated directly, the audit (and report transitively) will wrongly reference a stale finding instance. Thus, it should be evicted to prevent subsequent incorrect data reads.

Note that, as can be seen from the example, this sweep should be recursive.

@ledsoft ledsoft changed the title Sweep cache of instance possibly referencing updated entity Sweep cache of instances possibly referencing updated entity Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant