[appengine-java] Re: Problem with query - jdo

2011-03-04 Thread lp
 The persistence layer uses lazy-load approach, so when in jsp it tries to
 access to entities extracted from the database it throws exception because
 the persistence manager is just closed.
 So, how to avoid this problem?

so either use eager fetch... not a good idea for large objects.
OR
use a VTO pattern (http://java.sun.com/blueprints/patterns/
TransferObject.html) to populate ur presentation objects.
this enables the persistence layer transaction to be abstracted away
from presentation.

VTO pattern is more usefull.

-lp

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Problem with query - jdo

2011-03-03 Thread coder
I have understood the problem.

The persistence layer uses lazy-load approach, so when in jsp it tries to 
access to entities extracted from the database it throws exception because 
the persistence manager is just closed.
So, how to avoid this problem? I have to use DAO class or controller of them 
directly in jsp? Cannot i use in jsp the HttpSession to get the 
requested objects (putted in session by a servlet)?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.