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
We have 2 entities - one has OneToMany to a second entity (that has soft delete).
After stateless DB.update() on first entity and serializing the same instance (eg. via Jackson serialization ObjectMapper), the entity gets serialized without soft deleted records.
Actual behavior
After calling DB.update(entity), ObjectMapper serializes the instance with soft deleted records.
Accessing the OneToMany relationship and checking its size makes this issue to "go away". (also demonstrated in the unit test).
The same happened when I was trying to debug this issue, this issue didn't show (presumably debugger accessed the property and loaded it correctly). Currently unsure whether emptiness of the collection plays a role (eg. if the collection is not empty then the bug would/wouldn't happen).
Also the the select for workflow_entity by its id does not check whether it is deleted - not sure if it's a problem, could be a separate issue.
Steps to reproduce
Please see attached PR with domain and unit test.
I have modified slightly the domain used in #2727 (thanks for fixing that one).
Entities extend HistoryColumns that extends BaseDomain. HistoryColumns add LazyLoaded reference which play role in the test failing - if they are eager loaded the bug does not happen.
The text was updated successfully, but these errors were encountered:
…ialisation)
The effective fix is in DLoadContext, only allow includeSoftDeletes to be set from
the query when the query is SpiQuery.Mode.NORMAL (not a lazy loading query).
The effective fix is in DLoadContext, only allow includeSoftDeletes to be set from the query when the query is SpiQuery.Mode.NORMAL (not a lazy loading query).
Some background: We allow lazy loading softDeleted beans when they are single disconnected beans (e.g. from a L2 cache hit or in this case a stateless updated bean). What that lead to was this bug where that includeSoftDeletes propagates to the load context (DLoadContext) and instead we really only want includeSoftDeletes to propagates to DLoadContext when it's a top level query / the application code specified the query with includeSoftDeletes true.
Expected behavior
We have 2 entities - one has OneToMany to a second entity (that has soft delete).
After stateless DB.update() on first entity and serializing the same instance (eg. via Jackson serialization ObjectMapper), the entity gets serialized without soft deleted records.
Actual behavior
After calling
DB.update(entity)
, ObjectMapper serializes the instance with soft deleted records.Accessing the OneToMany relationship and checking its size makes this issue to "go away". (also demonstrated in the unit test).
The same happened when I was trying to debug this issue, this issue didn't show (presumably debugger accessed the property and loaded it correctly). Currently unsure whether emptiness of the collection plays a role (eg. if the collection is not empty then the bug would/wouldn't happen).
Also the the select for workflow_entity by its id does not check whether it is deleted - not sure if it's a problem, could be a separate issue.
Steps to reproduce
Please see attached PR with domain and unit test.
I have modified slightly the domain used in #2727 (thanks for fixing that one).
Entities extend HistoryColumns that extends BaseDomain. HistoryColumns add LazyLoaded reference which play role in the test failing - if they are eager loaded the bug does not happen.
The text was updated successfully, but these errors were encountered: