gavin wrote:
Ask yourself how you would do it if you were using entity beans or JDBC and then you will know how to do it in Hibernate (conceptually, at least).
It seems like the best answer is to have the method which prepares the page for user viewing ensure that the data has been initialized before directing to that page. It could check collection initialization status before returning the page and only call the session bean if the collection needs to be initialized.
If there is a good probability that all data which pertains to a certain user will be visible at some time during the user's session, shouldn't I just load everything at once when they log in and not try to do it lazily? Through all my reading it has been pounded into my head that only under rare circumstances should anyone use non-lazily initialized collections so I am hesistant to do so.
Any help would be much appreciated.
Thanks,
Justin