On Friday, September 9, 2011 9:23:51 AM UTC+2, Tiago wrote:
>
> Hello Thomas, 
>
> On Sep 8, 11:38 am, Thomas Broyer <[email protected]> wrote: 
> > I believe RF is not meant to be used with lazy-loading if you don't also 
> use 
> > (and accept the consequences) "OpenSessionInView". 
>
> That would be a pity. I thought the point of RF was dealing with ORM 
> entities without having to mind with stuff described here: 
> https://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html 
> Actually, I thought that preventing lazy initialization exceptions was 
> the point of the with() method... I wonder why it exists if not for 
> that...
>

There are basically two choices when modelling synchronous APIs on top of 
inherently asynchronous communications: get everything eagerly (with the 
risk of retrieve the database as a whole) so that a getContactDetails() 
always returns something, or get only what's requested (so that 
getContactDetails() either returns data if it was requested, or returns 
'null' otherwise).
RF falls in the second category (except that it doesn't apply it to 
properties with "simple values"), and .with() is the way to request data 
that wouldn't be loaded by default. By "loaded" here, we meant "serialized 
in the HTTP response", which is a different deal as to what can happen on 
the server.

.with() has nothing to do with lazy-loading or "lazy initialization 
exceptions"; it's only about what goes over the wire, and what's available 
on the client-side.

> or "unproxy" your objects rather than simply detaching them. 
>
> Would you advice the use of Gilead with RF for this?


I don't know Gilead (and I actually don't use JPA or JDO, but if I had to, I 
wouldn't use lazy-loading, it causes much more burden than what it's 
supposed to "solve", it's not worth it, it's a lie, it's counterproductive 
in the long run; JPA/JDO, like much "enterprisey" things, are 
over-engineered and much too complicated to get them to work unless you're 
an expert in the field).

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Vxbn57QUG6QJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to