[hibernate-issues] [JIRA] (HHH-13940) Hibernate session does not save subclass information correctly when using batch size >0 and hibernate.discriminator.ignore_explicit_for_joined

Willem Borgesius (JIRA) jira at hibernate.atlassian.net
Wed Apr 8 07:52:39 EDT 2020


Willem Borgesius ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aa0f89ea8-7da0-43df-a25a-21670d2fea0c ) *created* an issue

Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzNiMzY4M2U4YjViNGE2OWIyZGYyMzQ3N2MyN2VmMWMiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13940?atlOrigin=eyJpIjoiYzNiMzY4M2U4YjViNGE2OWIyZGYyMzQ3N2MyN2VmMWMiLCJwIjoiaiJ9 ) HHH-13940 ( https://hibernate.atlassian.net/browse/HHH-13940?atlOrigin=eyJpIjoiYzNiMzY4M2U4YjViNGE2OWIyZGYyMzQ3N2MyN2VmMWMiLCJwIjoiaiJ9 ) Hibernate session does not save subclass information correctly when using batch size >0 and hibernate.discriminator.ignore_explicit_for_joined ( https://hibernate.atlassian.net/browse/HHH-13940?atlOrigin=eyJpIjoiYzNiMzY4M2U4YjViNGE2OWIyZGYyMzQ3N2MyN2VmMWMiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 5.2.15, 5.2.16, 5.2.17, 5.2.18, 5.4.0, 5.4.9, 5.3.16 Assignee: Unassigned Attachments: hibernate-orm-5-ignore-explicit.zip Components: hibernate-core Created: 08/Apr/2020 04:52 AM Priority: Major Reporter: Willem Borgesius ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3Aa0f89ea8-7da0-43df-a25a-21670d2fea0c )

We have a use case to set the flag hibernate.discriminator.ignore_explicit_for_joined to true. Unfortunately we have code we can't change that uses inconsistent DiscriminatorValue's.

It seems that when hibernate.jdbc.batch_size is > 0 and hibernate.discriminator.ignore_explicit_for_joined is true, the data for the a subclass of InheritanceType.JOINED does not get saved.

I tried upgrading to 5.3.16.Final due to the fix of HHH-12968 ( https://hibernate.atlassian.net/browse/HHH-12968 ) Closed , but it did not solve my problem.

Our codebase uses hibernate 5.2.18.Final, but i created a unit test within our application to test over hibernate versions. It works as expected with hibernate 5.2.14.Final, and seems to be fixed in 5.4.10.Final.
I added a testcase derived from the template, trying to isolate the problem as much as possible.

The testcase passes with hibernate 5.4.10.Final and fails with versions between 5.2.18.Final and 5.4.10.Final.
The testcase also passes if either hibernate.discriminator.ignore_explicit_for_joined is set to false or hibernate.jdbc.batch_size is set to 0.

Due to the fact we use some external code we unfortunately can't upgrade to hibernate 5.3. In our osgi module there is a bundle dependency on org.hibernate.core bundle and this seems to have been moved to org.hibernate.orm.core).

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

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#100124- sha1:c13ca0d )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200408/ecdc2f59/attachment.html 


More information about the hibernate-issues mailing list