Query spaces for EntityGraph nodes/subgraphs are not currently added when applied to a Query, and so the session is not flushed if it contains updated data relevant to the EntityGraph that is not in the query spaces defined for the Query.
I originally though this was a critical issue, but now that I'm looking into it, I'm not so sure. I am having a hard time coming up with a test case where it matters. I've created a pull request with the test case attached to HHH-11213, with some added checks to detect if the session flushes. [1] In this case, the session does not flush, but the query results are still correct because the updated entity is taken from the Session, not from the ResultSet returned by the query. I wonder now if it really is necessary to flush the Session when the session has updates that apply *only* to the EntityGraph (and not to the base Query). Thoughts? Thanks, Gail [1] https://github.com/hibernate/hibernate-orm/pull/1707 _______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev