SELECT - FOR UPDATE NOWAIT hangs if lock cannot be acquired

Description

When using `find` to SELECT - FOR UPDATE NOWAIT, no exception is ever returned to the blocked thread, and it hangs.

The original test was in Spring Data JPA (see https://jira.spring.io/browse/DATAJPA-1259): I've tried my best to paraphase the test into straight Hibernate, but I don't have access to the tools here so there might be some bugs.

where the full test is

The code issues the SQL I would expect, I see this SQL twice in the logs

I would except some kind of exception, but in fact we just deadlock where I marked, and Awaitility kills the test after the timeout.

Please let me know if you need more details!

Environment

None

Assignee

Unassigned

Reporter

Tadhg Pearson

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure