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
Hello, I have a problem with this (nice) improvement: some sensible data are leaking in my logs. Do you think that could be an option to add the statement conditionnaly, for instance only when hibernate.show_sql=true ? Thanks
I created for that