gschadow wrote:
Thanks for bringing this up. I have been wondering about how to limit the tree walking depth, and now I see that all I have to do is close the session after having walked around enough. That's a good way.
Open session strategy is fine for the most of the applications. There're still cases like mine, where you like to close the session and live with the object graph you have. In this case the ILEs are only thing that reminds you about Hibernate lying under the DAO layer.
My current solution works fine for me now. There's a couple of quality objectives in my project that are clear separation in the architectural level, utilizing existing frameworks and minimazing the LOCs. I try to avoid custom code whenever it's possible. I've been a sort of NIH person so far and I'm pretty tired for that. That's the reason I don't want to code my own stuff for this. There's dozens of great XML binding frameworks and I don't want to create yet another... :) By the way, what is the name of your XML project?
I'm not fan of JAXB 2.0, but with the annotations it is ok and seems to work fine with Xfire (ws framework).
The reason of my original post is that I wasn't sure am I missing something fundamental right now...
Maybe we need some kind of mechanism to introduce OXM (object xml mapping) frameworks to the ORM frameworks? Then it's OXM's responsibility to handle different kind of LIEs. Or they can tell to the closed sessions, that do not throw any LIEs but give nulls instead of them, we can live them. :)
I don't have experience JDO or EJB3, how do they handle lazy initialization situations? Do they throw exceptions too?