Log the failing SQL when the batched execution throws a RuntimeException (e.g. StaleStateException)

Description

Currently, when using batched updates and Hibernate detects stale state (e.g. data row concurrently deleted or deleted by JPQL executed with NO_FLUSH), failing SQL is not logged. However, when SQLException occurs, the failing SQL is logged (and that's so much convenient!).

Please have SQL logged when execution fails with other exceptions (like StaleStateException) too.

Environment

None

Status

Assignee

Vlad Mihalcea

Reporter

Piotr Findeisen

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

Components

Priority

Minor
Configure