Skip to content

Composite key with generated value not working properly #2154

Open
@majchrzw

Description

@majchrzw

Hello, I encountered a bug when implementing composite key with generated value. My code is based on this tutorial: https://vladmihalcea.com/how-to-map-a-composite-identifier-using-an-automatically-generatedvalue-with-jpa-and-hibernate/ .
I did everything like in the link but it does not work with hibernate reactive. When i try to persist my entity i receive weird error:

org.hibernate.HibernateException: java.util.concurrent.CompletionException: org.hibernate.exception.GenericJDBCException: Unable to acquire JDBC Connection [Not using JDBC] [n/a]

When I used the same code in non-reactive hibernate everything is working as intended.
I created 2 reproducers here: https://github.com/majchrzw/composite-key .
main branch show the issue with hibernate reactive, while hibernate-orm branch show the working example.
Can this be somehow fixed?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions