[hibernate-issues] [JIRA] (HHH-3007) Unchanged persistent set gets marked dirty on session.merge()

Marco Janc (JIRA) jira at hibernate.atlassian.net
Wed Apr 22 11:21:25 EDT 2020


Marco Janc ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A92413475-3ea4-489b-9605-90e379db922b ) *commented* on HHH-3007 ( https://hibernate.atlassian.net/browse/HHH-3007?atlOrigin=eyJpIjoiMzYyMTZkODhhYjE0NDVlYjgxY2M3N2YwYWU4MDJkMjMiLCJwIjoiaiJ9 )

Re: Unchanged persistent set gets marked dirty on session.merge() ( https://hibernate.atlassian.net/browse/HHH-3007?atlOrigin=eyJpIjoiMzYyMTZkODhhYjE0NDVlYjgxY2M3N2YwYWU4MDJkMjMiLCJwIjoiaiJ9 )

@Gail Badner

In case it is not the same reference or just not of type PersistentCollection ?

That specification seems like a lazy approach in case a collection is loaded eager. A collection should be dirty if state of any element has changed (create, updated, deleted) not if itself has changed.

*Use case*

This problem occured when we clean our entities from hibernate types in our application server to send to the client by remote java beans. Before sending we replace all PersistentCollection with their normal instances like HashSet since the client has no hibernate at class path. We pass entities instead of DTO in many cases.

When receiving them back from the client to update the changes the collections are marked as dirty even nothing has changed.

( https://hibernate.atlassian.net/browse/HHH-3007#add-comment?atlOrigin=eyJpIjoiMzYyMTZkODhhYjE0NDVlYjgxY2M3N2YwYWU4MDJkMjMiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-3007#add-comment?atlOrigin=eyJpIjoiMzYyMTZkODhhYjE0NDVlYjgxY2M3N2YwYWU4MDJkMjMiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100125- sha1:0a83519 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200422/ee417118/attachment.html 


More information about the hibernate-issues mailing list