Skip to content

"Not using JDBC" when locking previously loaded entities in Hibernate Reactive 3 #2332

@markusdlugi

Description

@markusdlugi

This seems to be a regression of #1258 in Hibernate Reactive 3. When trying to create a lock on an entity that already exists within the current session, this fails with the following error:

Caused by: java.sql.SQLException: HR000084: The application requested a JDBC connection, but Hibernate Reactive doesn't use JDBC. This could be caused by a bug or the use of an unsupported feature in Hibernate Reactive
	at org.hibernate.reactive.provider.service.NoJdbcConnectionProvider.getConnection(NoJdbcConnectionProvider.java:30)
	at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:44)
	at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:118)
	... 104 more

This was still working fine with Hibernate 6 / HR 2.

Reproducer: https://github.com/markusdlugi/hr-lock-reproducer

Steps to reproduce:

  1. Run PersonResourceTest
  2. Observe that the test fails with an HTTP 500 and the aforementioned error message
  3. Remove the lock and observe that the test now passes
  4. Alternatively, change the first findById() call to fetch the entity with a lock from the start and observe that the test also passes this way

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions