I don't think you're misunderstanding. Their implementation causes me (and countless others) constant headaches.
HibernateSession is the closest thing in Hibernate to the Cayenne ObjectContext (DataContext). But they aren't perfectly aligned.
A session is certainly closer in sensibilities to a (managed) transaction than the ObjectContext is, although not perfectly analogous to a transaction, either. A session /can/ be held across multiple requests, and may or may not have a transaction associated with it at the current time. But the general pattern is session-per-request by default (I think seam changes this to "session-per-conversation").
Robert
On Sep 6, 2010, at 9/62:24 PM , Joe Baldwin wrote:
> Robert,
>
>> And basically, that's it in a nutshell. The thread is discussing fetching a lazy relationship after the session has closed. If that were the /only/ "fringe case" of lazy relationship navigation in hibernate, it would probably be tolerable. But it turns out, it's /not/ the only fringe case. I constantly encounter what I would call "rough edges" around Hibernate's lazy fetching.
>
> It took a bit to find a simple quote from the thread, but I think this is it:
>
> "The problem is in Hibernate's lazy loading: you can't load non-initialized objects after session is disconnected/closed."
>
> I am still a bit confused by the jargon, because I thought "hibernate session" was analogous to "DataContext". However, in this thread you referenced, it sounds like they are using it as if it were analogous to a "transaction" or maybe even a transient "database connection".
>
> Also, if I understand Gavin, (and as you point out) it sounds as if he does not embrace "faulting behavior" (aka lazy fetching) as part of the core responsibilities of an ORM.
>
> If I understand these comments, then I would have to disagree with their core ORM design pattern, because it is my opinion that intelligent-faulting behavior is one of the most important functions of an ORM. NeXT/Apple EOF (one of the first ORM implementations) included transparent faulting (very similar to Cayenne in behavior) well before Hibernate was even started.
>
> Again, if I understand the comments, the Hibernate faulting design sounds like a very primitive and naive implementation.
>
> Am I misunderstanding this (or being too harsh)?
>
> Thanks,
> Joe
>
>
>
>
This archive was generated by hypermail 2.0.0 : Mon Sep 06 2010 - 19:41:36 UTC