Hi all,
Java persistence with Hibernate states that "a subselect is only remembered by hibernate for a particular Session". Despite this I noticed that after session.getTransaction().commit() the subselect fetch is disabled, even if the session is not yet closed. For example:
1) This works
parents = ....
parents.get(0).getChildren().get(0) <-- children for all parents are fetched
session.getTransaction().commit()
session.close()
2) This doesn't work
parents = ....
session.getTransaction().commit()
parents.get(0).getChildren().get(0) <-- only children for parent 0 are fetched
session.close()
This behavior is particularly annoying because transactions are commited at the services layer and after that the view can't take advantage of subselect optimizations anymore.
Is this expected or should I file an issue into the jira?
Regards
-Carlos
|