users@glassfish.java.net

Re: Glassfish + TopLink Lazy Loading

From: Sahoo <Sahoo_at_Sun.COM>
Date: Thu, 13 Dec 2007 22:01:05 +0530

The exception is self explanatory. Before returning the entity
containing the collection from the EJB's business method, call
collection.size() or something like that which triggers the collection
to be populated.

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> I try it,
> But obtain the follow exception:
>
> Exception Description: An attempt was made to traverse a relationship using indirection that had a null Session. This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that lazy relationship is traversed after serialization. To avoid this issue, instantiate the LAZY relationship prior to serialization.
>
> I init the collection by
> collectionVar = new ArrayList<Var>();
> in the constructor
> [Message sent by forum member 'peppeme' (peppeme)]
>
> http://forums.java.net/jive/thread.jspa?messageID=249943
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>