hello,
appologies but i'm going to have to bring this up again in the hope that someone will have a solution or workaround.
I am making a client admin app and need to display a gui tree of the data graph. i would like to enable transparent lazy loading of the data so that the presentation tier is unaware of hibernate. the data graph is potentially huge - has the potential of being the entire database, so lazy-loading is a must.
The problem is that in order for the collections to load they must have an open session associated with them. One option, which i am not keen on, is to share one session with all objects in the graph and leave it open for the entire life of the application.
So, discarding that i need some way for the collection to be assigned to a new session, loaded and then the session closed, all transparent to the ui & user.
i have thought about implementing my own collection loading queries in a dao, but then i would miss out on the save\update features supplied with the hibernate collection framework.
i have also thought about having a separate businessobject hierarchy for hibernate and passing initialized collections over to the application Bo hierarchy on first demand, but this would double the number of objects in the system both in staticlly and at runtime, and it would would initialize the collection on method call instead of on a read.
does anyone have any ideas that i haven't thought of, or any comments on these?
thanks, cam
|