-
Notifications
You must be signed in to change notification settings - Fork 96
UnexpectedAccessToTheDatabase error when merging a detached entity with a ToMany association #2026
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
Comments
Have you tried turning it on and off again? |
Fixed by #2066 |
DavideD
pushed a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
…etached entity with a ToMany association
DavideD
pushed a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
…n merging a detached entity with a ToMany association
DavideD
added a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
It's using a `.thenApply` instead of a `.thenCompose`.
DavideD
added a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
DavideD
pushed a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
…etached entity with a ToMany association
DavideD
pushed a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
…n merging a detached entity with a ToMany association
DavideD
added a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
It's using a `.thenApply` instead of a `.thenCompose`.
DavideD
added a commit
to DavideD/hibernate-reactive
that referenced
this issue
Jan 20, 2025
DavideD
pushed a commit
that referenced
this issue
Jan 20, 2025
… a detached entity with a ToMany association
DavideD
added a commit
that referenced
this issue
Jan 20, 2025
It's using a `.thenApply` instead of a `.thenCompose`.
DavideD
added a commit
that referenced
this issue
Jan 20, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Allow me to clarify;
My system has Users and roles. A user can have many roles, and each role can belong to multiple users. A User has a list of roles, mapped as ManyToMany, fetched eagerly. It is also using an intermediary table with a composite id.
Consider the code below;
The problem:
In the above code an existing user is updated and persisted. The user is retrieved by Id, all Roles are retrieved, the user is updated given the provided data & chosen roles, and persisted again. The problem occurs in userRepository.updateUser(cmsUser). I've been able to figure out that the issue must be related to the relationship between Users and Roles. If a user gets persisted, and has less roles coupled to it than it did before, i get no issues. As soon as an existing role that was not yet coupled to the user, does get coupled, i get the error on persisting. Below i will provide the specific error as well as some other classes. This is my first issue post, so hopefully it is formatted in a somewhat proper manner. Thanks alot in advance because this one is really puzzling me :o
org.hibernate.HibernateException: java.util.concurrent.CompletionException: org.hibernate.reactive.event.impl.UnexpectedAccessToTheDatabase: Unexpected access to the database
Repository methods:
CmsUser:
A CmsRole
The text was updated successfully, but these errors were encountered: