StaleStateException does not log out the stale object or the statement that was executed

Description

It would be really helpful if when a StaleStateException is thrown from Expectations.BasicExpectation that the statement can be included in the error message. The information is available in the parameter 'PreparedStatement statement'.

Currently the error thrown is:

But it could be:

I see a similar change was made https://github.com/hibernate/hibernate-orm/commit/f18656473dc3112c76240a6c3f47a5050608de75#diff-0

Environment

None

Assignee

Daniel Smith

Reporter

Frank Sloan

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Minor
Configure