During high load Hibernate does not set schema when transaction pooling is set

We have pgbouncer setup which uses transaction pool mode. From our Multi tenant (Schema per tenant) Spring boot app(which uses HikariCP) we are making CRUD operations. We also have p6spy in place to log statement execution(slightly modified to include schema name as well).

Frequently we observed that schema is not set for during statement execution, because of which it throw “relation xyz does not exist”.

Issue is similar to How can I disable prepared statements… but the resolution the question poster had to set the hibernate.default_schema, which we cannot do because ours is mulit-tenant app.

Hibernate version: 5.6.9
Spring boot 2.7.12

Try updating to 5.6.15.Final