I can also confirm this in 5.2.10.Final. This bug seems rather significant to anyone who has worked with operations teams to tackle productive cursor cache contention problems (e.g. in Oracle), which can drastically impair response times on highly loaded systems. Other database vendors will be affected as well. Of course, the workaround is trivial for people who are aware of this problem and who find this issue. Just use native queries or JDBC or something else, or if all else fails, tamper with server configurations to enforce cursor sharing (there are other drawbacks to this approach). But I strongly advise the Hibernate team review the priority of solving this problem also in pre-6.0 releases. More info here: https://oracle-base.com/articles/misc/literals-substitution-variables-and-bind-variables |