Within our project, we have updated Spring to 4.3.14.RELEASE
and Hibernate to 4.3.11.Final
and since we have started seeing two warnings:
WARN JDBC Connection to reset not identical to originally prepared Connection - please make sure to use connection release mode ON_CLOSE (the default) and to run against Hibernate 4.2+ (or switch HibernateJpaDialect's prepareConnection flag to false
- The cure is to switch the release mode to
ON_CLOSE
, which we don't want – when our app is under heavy load, at some point it stops releasing the connections and the application gets stuck. This works correctly with release mode AFTER_TRANSACTION. - The message doesn't say what happens if this error is ignored. Googling doesn't show anything definitive
- What happens if we switch the
prepareConnection
flag tofalse
? I tried to find such flag in Hibernate configuration but couldn't find it.
- The cure is to switch the release mode to
GooGooStatementCache:441 - Multiply prepared statement!
- Is this warning related to the previous one? Is it something we should worry?
EDIT: I updated Hibernate to 5.2.13.Final
.
@Transactional
annotation, I don't really open, nor close connections, so it is hard to say, how could it lead to these. I can see the text of the PreparedStatement, but as this is an SQL for fetching an entity, this can be anywhere in the project. I guess stack trace would be much more helpful. Anyway, you are jsut answering the second part of question, but the first is the one which is more important. – Kaela