In Spring Boot 3.3.7 funktionierte der nächste Code wie erwartet:
Code: Select all
public void deepDelete(Category category) {
//Catalog-category
catalogCategoryService.deleteByCategory(category);
delete(category);
}
Code: Select all
12T14:17:15.098+02:00 ERROR 26596 --- [io-8080-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.TransientObjectException: persistent instance references an unsaved transient instance of 'com.techi.gox.model.Category' (save the transient instance before flushing)] with root cause
org.hibernate.TransientObjectException: persistent instance references an unsaved transient instance of 'com.techi.gox.model.Category' (save the transient instance before flushing)
at org.hibernate.engine.spi.CascadingActions$9.cascade(CascadingActions.java:382) ~[hibernate-core-6.6.2.Final.jar:6.6.2.Final]
at org.hibernate.engine.spi.CascadingActions$9.cascade(CascadingActions.java:372) ~[hibernate-core-6.6.2.Final.jar:6.6.2.Final]
Vielen Dank!