You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cascading save on b ... will first cascade to save the a instance ... but this incorrectly results in a update rather an insert.
The reason is that when cascading it is ultimately detecting if a instance should be inserted or updated and is falling back to using Id value existence check (in DefaultPersister createRequestRecurse() method).
The fix we can employ is to note that the persist is 'normal' in that we are doing update on a bean that is in LOADED state (so update is normal matching the bean state and this isn't a forced update / stateless update).
So if the parent request is a 'normal' persist then we should use the bean state to determine insert or update on the recursive state to instance a. As the bean state is NEW this results in an insert (what we want) rather than the update (this bug).
The text was updated successfully, but these errors were encountered:
Steps to reproduce
Cascading save on
b
... will first cascade to save the a instance ... but this incorrectly results in aupdate
rather aninsert
.The reason is that when cascading it is ultimately detecting if a instance should be inserted or updated and is falling back to using
Id value existence
check (in DefaultPersister createRequestRecurse() method).The fix we can employ is to note that the persist is 'normal' in that we are doing update on a bean that is in LOADED state (so update is normal matching the bean state and this isn't a forced update / stateless update).
So if the parent request is a 'normal' persist then we should use the bean state to determine insert or update on the recursive state to instance a. As the bean state is NEW this results in an insert (what we want) rather than the update (this bug).
The text was updated successfully, but these errors were encountered: