Hibernate Panache Quarkus update cancelled

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!

I haven’t heard of similar issues before, I don’t see why simply accessing a to-many property would “lock” the whole entity for updates.

If needed, I can provide a GitHub link with the codebase.

Since this behavior is happening inside a Quarkus + Panache application, maybe you should try asking them first or report an issue in their tracker.

If this is an Hibernate bug, please try creating a reproducer using Hibernate only with our test case template and if you are able to reproduce the issue, create a new ticket in our issue tracker and attach that reproducer and we’ll be more than happy to look into it.

Thanks a lot for your fast response, I will try asking the Panache or Quarkus Team.