Hi,
I am new to this community .
After we migrate from hibernate 5 to 6, now we got some errors for Cascade delete and direct delete in a single transaction.
Is this error expected now on hibernate-6? On hibernate-5, it didn’t give ERROR.
Any recommended fixes for this issue?
The Entity “deployment” has this bag:
@OneToMany(fetch = FetchType.LAZY, mappedBy = "deploymentId", orphanRemoval = true, cascade = CascadeType.ALL)
private Set<ApplicationConfiguration> applicationConfigurations = new HashSet<>();
ApplicationConfiguration is another Entity.
In one @Transactional method, we directly update on the ApplicationConfiguration entity, also cascade Delete the deployment, such as Pesudo code:
remove_some_applicationConfiguration(deployment);
delete_Deployment(deployment);
Now on hibernate-6 we got ERROR:
HibernateOptimisticLockingFailureException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1 statement executed: delete from configuration where id=?
Thanks