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
I have an entity with ordinary properties, a property with optimistic-lock="false" and a set (implicitly with optimistic-lock="true" as it's the default value).
If I just add a child entity to the collection, the version is incremented correctly but if I change a property without optimistic lock at the same time, the version is not incremented.
The version must be incremented if at least one property (including collections) with optimistic-lock="true" is changed.
The reason is that FlushEntityEvent.HasDirtyCollections is not filled in case there dirty properties but this doesn't take into consideration whether the dirty properties lead to a version increment. Calling DefaultFlushEntityEventListener.HasDirtyCollections is necessary because of the side effect it has on the Event.
The text was updated successfully, but these errors were encountered:
wvopt
pushed a commit
to csharper2010/nhibernate-core
that referenced
this issue
Dec 10, 2024
Incrementing Version on parent entity for a collection change works correctly
even with optimistic-lock="false" on another property of the same entity.
Call to HasDirtyCollections has a side effect thus must be called independently
from the existence of other dirty properties.
wvopt
pushed a commit
to csharper2010/nhibernate-core
that referenced
this issue
Dec 10, 2024
Incrementing Version on parent entity for a collection change works correctly
even with optimistic-lock="false" on another property of the same entity.
Call to HasDirtyCollections has a side effect thus must be called independently
from the existence of other dirty properties.
I have an entity with ordinary properties, a property with optimistic-lock="false" and a set (implicitly with optimistic-lock="true" as it's the default value).
If I just add a child entity to the collection, the version is incremented correctly but if I change a property without optimistic lock at the same time, the version is not incremented.
The version must be incremented if at least one property (including collections) with optimistic-lock="true" is changed.
The reason is that
FlushEntityEvent.HasDirtyCollections
is not filled in case there dirty properties but this doesn't take into consideration whether the dirty properties lead to a version increment. CallingDefaultFlushEntityEventListener.HasDirtyCollections
is necessary because of the side effect it has on theEvent
.The text was updated successfully, but these errors were encountered: