[hibernate-issues] [JIRA] (HHH-14043) Two concurrent element shifts in a list damage database integrity.

Björn Zurmaar (JIRA) jira at hibernate.atlassian.net
Wed Jun 17 17:29:12 EDT 2020


Björn Zurmaar ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5ecd86c3dacd410c1f8c8da5 ) *commented* on HHH-14043 ( https://hibernate.atlassian.net/browse/HHH-14043?atlOrigin=eyJpIjoiYTkwMGYwZmRkNmViNGE1Nzg1ZGMzY2MzYjkzY2MyNGUiLCJwIjoiaiJ9 )

Re: Two concurrent element shifts in a list damage database integrity. ( https://hibernate.atlassian.net/browse/HHH-14043?atlOrigin=eyJpIjoiYTkwMGYwZmRkNmViNGE1Nzg1ZGMzY2MzYjkzY2MyNGUiLCJwIjoiaiJ9 )

Thanks for having a look at this issue, Christian. The example above uses optimistic locking according to e1.getLockMode(foo1). This seems to be the default? This is also the lock mode I got in Wildfly when I originally discovered the problem. I wasn’t aware you can run hibernate without transaction management / locking.

I’m totally not an expert on this, but from my current point of view the lock mode operates on a per table row basis. This would not be sufficient to protect against this kind of problem. The root of the problem is that hibernate only updates the indices of the list elements it thinks have changed. This is what effectively prevents locking from kicking in here because the other table rows never get touched but have to be considered to keep the indices sane. It should take into account that other indices might have changed in the meantime.

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

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#100129- sha1:3ed9692 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200617/ffcc1be5/attachment.html 


More information about the hibernate-issues mailing list