Hello,
I currently work on an open source project and run into an interesting issue. We have setup our Database Entities with Panache (we run our Backend with Quarkus + Panache).
When I try to validate data coming through a REST Endpoint, I somehow seem to “lock” the Entity from any changes, causing the update to being completely cancelled.
I could pinpoint the error to 2 specific lines, and no matter where I put them, as long as they are inside of the workflow triggered by the REST request, the update does not get persisted on the Database:
Dataset dataset = Dataset.findById(1L);
log.info(dataset.getDistributionList());
If I access any other attribute like:
Dataset dataset = Dataset.findById(1L);
log.info(dataset.getTitle());
Everything works fine. The problematic getter returns the attribute from the entity:
@OneToMany(
mappedBy = "dataset",
cascade = {CascadeType.ALL},
orphanRemoval = true)
private List<Distribution> distributionList = new ArrayList<>();
Is there some undocumented side effect that could cause such behavior or has such a behavior allready occured for someone else. No matter what I try, I can’t figure it out. It seems to be pretty specific, as simply commenting out the log.info (only as a placeholder for the actual validation) is enough to fix it (but I obviously need to access the field to validate).
If needed, I can provide a GitHub link with the codebase.
Thanks a lot for anyone taking time to try to help me!