[hibernate-issues] [JIRA] (HHH-14016) Can not prevent cache region from being cleared from second level cache on bulk update

Erik (JIRA) jira at hibernate.atlassian.net
Tue May 12 13:57:05 EDT 2020


Erik ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A591235db-57c4-45b1-a52d-208c47f92323 ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMWJiOWMxZTdmMTY0NGVmNDg4ODcxODU0ZmQ0ZmNlNzciLCJwIjoiaiJ9 ) / Improvement ( https://hibernate.atlassian.net/browse/HHH-14016?atlOrigin=eyJpIjoiMWJiOWMxZTdmMTY0NGVmNDg4ODcxODU0ZmQ0ZmNlNzciLCJwIjoiaiJ9 ) HHH-14016 ( https://hibernate.atlassian.net/browse/HHH-14016?atlOrigin=eyJpIjoiMWJiOWMxZTdmMTY0NGVmNDg4ODcxODU0ZmQ0ZmNlNzciLCJwIjoiaiJ9 ) Can not prevent cache region from being cleared from second level cache on bulk update ( https://hibernate.atlassian.net/browse/HHH-14016?atlOrigin=eyJpIjoiMWJiOWMxZTdmMTY0NGVmNDg4ODcxODU0ZmQ0ZmNlNzciLCJwIjoiaiJ9 )

Issue Type: Improvement Affects Versions: 5.4.15 Assignee: Unassigned Created: 12/May/2020 10:57 AM Priority: Minor Reporter: Erik ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A591235db-57c4-45b1-a52d-208c47f92323 )

Bulk updates using queries or the criteria API can be used to avoid fetching an entity before executing the update. For example:

UPDATE User u SET u.deleted = true WHERE u.id = :id

In this case, the only modified entity is known, and the entity in question could be manually evicted from the second level cache.

Instead, the whole cache region is evicted through a BulkOperationCleanupAction , and I have not been able to find a workaround for this. Currently it seems like it'd require modifying the EntityPersister itself, as this is where the affected regions are taken from.

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

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#100126- sha1:dd08494 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200512/b1541833/attachment.html 


More information about the hibernate-issues mailing list