Found while following the skill on a Jmix 3.0.1 project.
Problem: silent — the audit's own first requirement is not achievable through the API the section recommends.
Task
@AfterEach cleanup for an integration test that creates rows of a soft-deletable entity, in a project whose test store is an HSQLDB file that survives gradle clean.
Where
"Cleanup Audit" — "Every created persistent record is removed in @AfterEach", "Cleanup reloads by id then removes instead of removing the instance that can be stale", and the note that a fixed in-memory datasource is shared for the whole run.
What happened
The audit is careful about staleness, FK order and a shared datasource, so it reads as a complete account of what teardown must get right. It never says that dataManager.remove of a soft-deletable entity does not remove anything — it stamps the row, which then stays in the store for every later run, and stays visible to any query issued with soft deletion off. The list's own first line, "every created persistent record is removed", is therefore not achievable through the API the rest of the section recommends.
The idiom that does work is
dataManager.save(new SaveContext()
.setHint(PersistenceHints.SOFT_DELETION, false)
.removing(entity));
which took reading SaveContext's members in the jar to find, since neither this skill nor jmix-create-entity mentions it.
Caught in code review.
Suggested fix
Add one bullet to the Cleanup Audit — a soft-deletable entity is not removed by DataManager.remove, only stamped, so a test that must leave the store clean removes it with new SaveContext().setHint(PersistenceHints.SOFT_DELETION, false).removing(...). Worth one clause on why it matters more than it looks: a file-backed or fixed-name in-memory store accumulates the stamped rows across runs, and the section already warns about exactly that sharing for the read case.
Found while following the skill on a Jmix 3.0.1 project.
Problem: silent — the audit's own first requirement is not achievable through the API the section recommends.
Task
@AfterEachcleanup for an integration test that creates rows of a soft-deletable entity, in a project whose test store is an HSQLDB file that survivesgradle clean.Where
"Cleanup Audit" — "Every created persistent record is removed in
@AfterEach", "Cleanup reloads by id then removes instead of removing the instance that can be stale", and the note that a fixed in-memory datasource is shared for the whole run.What happened
The audit is careful about staleness, FK order and a shared datasource, so it reads as a complete account of what teardown must get right. It never says that
dataManager.removeof a soft-deletable entity does not remove anything — it stamps the row, which then stays in the store for every later run, and stays visible to any query issued with soft deletion off. The list's own first line, "every created persistent record is removed", is therefore not achievable through the API the rest of the section recommends.The idiom that does work is
which took reading
SaveContext's members in the jar to find, since neither this skill norjmix-create-entitymentions it.Caught in code review.
Suggested fix
Add one bullet to the Cleanup Audit — a soft-deletable entity is not removed by
DataManager.remove, only stamped, so a test that must leave the store clean removes it withnew SaveContext().setHint(PersistenceHints.SOFT_DELETION, false).removing(...). Worth one clause on why it matters more than it looks: a file-backed or fixed-name in-memory store accumulates the stamped rows across runs, and the section already warns about exactly that sharing for the read case.