hibernate-orm icon indicating copy to clipboard operation
hibernate-orm copied to clipboard

Restore hibernate.jdbc.batch_versioned_data function.

Open ettavolt opened this issue 1 year ago • 5 comments

batch_versioned_data=false is particularly useful to enable reporting the exact entity that failed optimistic lock.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion. For more information on licensing, please check here.


https://hibernate.atlassian.net/browse/HHH-18621

ettavolt avatar Aug 31 '24 23:08 ettavolt

Thanks for your pull request!

This pull request appears to follow the contribution rules.

› This message was automatically generated.

I feel like this might be covering https://hibernate.atlassian.net/browse/HHH-10501. May I use it as the required Jira reference?

ettavolt avatar Aug 31 '24 23:08 ettavolt

I feel like this might be covering https://hibernate.atlassian.net/browse/HHH-10501.

It is not.

May I use it as the required Jira reference?

No, please open a new issue with a proper description of the problem you're fixing. Thanks.

gavinking avatar Sep 08 '24 08:09 gavinking

batch_versioned_data=false is particularly useful to enable reporting the exact entity that failed optimistic lock.

Since HHH-18586, Hibernate 7 reports a proper StaleObjectStateException when a batch update fails.

Which means that your test will pass even without this fix.

gavinking avatar Sep 16 '24 07:09 gavinking

(FTR, the actual fix looks reasonable to me, though I'm not an expert on that code.)

gavinking avatar Sep 16 '24 07:09 gavinking

Thanks for the contribution, but without a test for the functionality I could not apply the fix. Instead I decided to remove the functionality: https://github.com/hibernate/hibernate-orm/pull/9717

gavinking avatar Feb 08 '25 14:02 gavinking