[hibernate-issues] [JIRA] (HHH-13867) StaleObjectStateException into a SINGLE transaction for entity with version field of type java.util.Date

Nathan Xu (JIRA) jira at hibernate.atlassian.net
Sun Feb 16 10:45:45 EST 2020


Nathan Xu ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Af1c90216-c2ff-4df7-8e20-9d0e140d7f64 ) *commented* on HHH-13867 ( https://hibernate.atlassian.net/browse/HHH-13867?atlOrigin=eyJpIjoiY2RlN2ZkNGY0YzAyNDBmMjkwZDI0YmIzYTZkMGM0MjgiLCJwIjoiaiJ9 )

Re: StaleObjectStateException into a SINGLE transaction for entity with version field of type java.util.Date ( https://hibernate.atlassian.net/browse/HHH-13867?atlOrigin=eyJpIjoiY2RlN2ZkNGY0YzAyNDBmMjkwZDI0YmIzYTZkMGM0MjgiLCJwIjoiaiJ9 )

It turns out that the root cause is MySQL doesn’t adhere to SQL standard that default TIMESTAMP type’s fractional second precision should be 6 (to maintain backward compatibility). See https://dev.mysql.com/doc/refman/5.6/en/fractional-seconds.html

In your specific case, if you specify precision explicitly, the bug should disappear.

However, this seems still a bug of Hibernate in terms of MySQL dialect issue. I’ll think about how to fix it later soon.

Thanks for your report!

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

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#100120- sha1:2415f4c )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200216/a16510f1/attachment.html 


More information about the hibernate-issues mailing list