Hibernate is not persisting the hierarchy when using Inheritance strategy JOINED with Batch size

Description

Hibernate is not persisting the hierarchy when using Inheritance strategy JOINED and Batch size > 1. It is weird because it prints the SQL in the console, but just the first entity is persisted (the root entity), the other (the child) has the insert printed but nothing happens at database level.

Here are some information regarding the configuration:

The entities:

The test:

Also, here you will find the link to the test case following the template:
https://github.com/thiagohora/hibernate-test-case-issue-Inheritance-strategy-joined

Environment

None

Activity

Show:
Stephen Fikes
August 30, 2019, 8:06 PM
Edited

The issue seems to be unique not only to the use of JOINED inheritance and batch_size > 1 but also to the use of the legacy ID generation strategy (disabling normal generation using id.new_generator_mappings="false"). Also found that when several entities are persisted in a transaction all but the final entity seem to be persisted correctly.

Thiago Hora
September 4, 2019, 5:53 AM

But in the case of Mysql, this property is used to make hibernate use the native auto_increment strategy, no?

Gail Badner
September 6, 2019, 11:52 PM

, this is a duplicate of HHH-12968. I'll use to backport to 5.3.

Assignee

Gail Badner

Reporter

Thiago Hora

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.12
5.2.14
5.4.0
5.4.4

Components

Affects versions

Priority

Major
Configure