[hibernate-issues] [JIRA] (HHH-13174) L1 Cache object updating issue

Christian Beikov (JIRA) jira at hibernate.atlassian.net
Wed Jul 22 02:54:52 EDT 2020


Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A0222998d-a0c8-4789-91ec-6a92d10dfb9a ) *commented* on HHH-13174 ( https://hibernate.atlassian.net/browse/HHH-13174?atlOrigin=eyJpIjoiZjBkMzk3ZGYxM2E5NDMzYWFjMTIxZDI4NTBiYWUxNzQiLCJwIjoiaiJ9 )

Re: L1 Cache object updating issue ( https://hibernate.atlassian.net/browse/HHH-13174?atlOrigin=eyJpIjoiZjBkMzk3ZGYxM2E5NDMzYWFjMTIxZDI4NTBiYWUxNzQiLCJwIjoiaiJ9 )

This is expected and is actually the reason why the {{ON}}clause is disallowed for fetch joins. Changing the elements of a collection through a filter condition changes the persistent state that Hibernate observes, so this kind of query might even lead to elements being deleted.

You should never use a filter condition on a join alias of a fetch joined collection or singular attribute reached through a fetch join of a collection.

You should use a custom projection without join fetching instead.

SELECT u, c from User u JOIN u.childrenList s WHERE s.id = 1

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

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#100133- sha1:ead1094 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200722/7930a4f9/attachment.html 


More information about the hibernate-issues mailing list