diff --git a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/ConcreteSqmSelectQueryPlan.java b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/ConcreteSqmSelectQueryPlan.java index a6d077fa27..1de86c6cac 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/ConcreteSqmSelectQueryPlan.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sqm/internal/ConcreteSqmSelectQueryPlan.java @@ -163,10 +163,8 @@ public class ConcreteSqmSelectQueryPlan implements SelectQueryPlan { final JdbcSelect jdbcSelect = sqmInterpretation.getJdbcSelect(); jdbcSelect.bindFilterJdbcParameters( jdbcParameterBindings ); - session.autoFlushIfRequired( jdbcSelect.getAffectedTableNames() ); - try { - session.autoFlushIfRequired( sqmInterpretation.getJdbcSelect().getAffectedTableNames() ); + session.autoFlushIfRequired( jdbcSelect.getAffectedTableNames() ); return session.getFactory().getJdbcServices().getJdbcSelectExecutor().list( jdbcSelect, jdbcParameterBindings,