-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Transaction commit fails with TransientObjectException: persistent instance references an unsaved transient instance
#3712
Comments
I'm pretty sure it caused by bug fix hibernate/hibernate-orm@055570c, I'm not sure you are using in correct way, I didn't dig too much because the code is a bit hard to read. |
TransientObjectException: persistent instance references an unsaved transient instance
I can reproduce the issue with using the EntityManager: CriteriaBuilder cb = entityManager.getCriteriaBuilder();
CriteriaQuery<UserNotifEntity> criteriaDelete = cb.createQuery(UserNotifEntity.class);
Root<UserNotifEntity> from = criteriaDelete.from(UserNotifEntity.class);
criteriaDelete.where(cb.equal(from.get("user"), user), cb.equal(from.get("typeNotif"), typeNotif));
Query query = entityManager.createQuery(criteriaDelete);
List resultList = query.getResultList();
for (Object o : resultList) {
entityManager.remove(o);
} On the flip side, using a |
Nice thank you! |
Commiting a transaction in which a deletion has been made on an entitu referenced by others element in cache results in an exception. may be related to #055570c8af7c8455d6ae318d589c47441c55850c This issue was initialy raised in spring-data-jpa but then redirected to hibernate (spring-projects/spring-data-jpa#3712)
Commiting a transaction in which a deletion has been made on an entitu referenced by others element in cache results in an exception. may be related to #055570c8af7c8455d6ae318d589c47441c55850c This issue was initialy raised in spring-data-jpa but then redirected to hibernate (spring-projects/spring-data-jpa#3712)
This issue was introduced with Hibernate 6.6. |
For anyone interested the
Issue has been reported to hibernate team :
https://hibernate.atlassian.net/browse/HHH-18936
Downgrading is not possible for us due to another hibernate issue (
https://hibernate.atlassian.net/browse/HHH-18400). But thanks for the tips.
Le ven. 27 déc. 2024, 20:31, Pål Høye ***@***.***> a écrit :
… This issue was introduced with Hibernate 6.6.
Hibernate 6.5.3 does not have this issue.
Short term work-around is to specify Hibernate dependency as 6.5.3.Final.
—
Reply to this email directly, view it on GitHub
<#3712 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOEC35L6Z3F2Q5RESIJ53DT2HWTHZAVCNFSM6AAAAABTPQ3LMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRTHE3TINBQGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Hi,
Overview
We met an unexpected error upgrading to spring-boot 3.4.0
I'm not sure this bug deals with spring-data, but i have not been able to reproduce the default using hibernate directly ; maybe you may provide new directions of investigations...
Here is a sample project representing the default with the minimal configuration needed to reproduce it : https://github.com/tcordel/jpa-named-query/tree/main
Details
This issue appears only if the optional fetch is done here : NotificationService
Entities
Tests
List of the tests present in DemoApplicationTests :
Thanks for your time :)
The text was updated successfully, but these errors were encountered: