|EclipseLink-7242 [message #484854]
||Wed, 09 September 2009 09:53
Registered: July 2009
I'd like to change the jpa implementation of all systems of my company
from Openjpa to Eclipselink.
No big deal until start to test lazy loading relationship and get this
Exception [EclipseLink-7242] (Eclipse Persistence Services -
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.
This exception happens whenever I call an EJB that returns an entity with
a lazy relationship from outside the EJB container (webservice or web).
Sometimes I don't want to 'instantiate the LAZY relationship prior to
serialization.', because I don't want to work with the relationships.
Openjpa returns a empty Collection in those cases. Eclipselink returns a
Linked List that returns this exception when I try to use it.
Is there a way to configure Eclipselink to have the same behavior of