I am using the current release of GlassFish 4.1 with EclipseLink version 2.5.2 included. At this GlassFish, I have an enterprise application and a web application deployed. If an EJB that returns a loaded entity, is called from outside the GlassFish (like an external JavaFX application), the entity is returned properly.
But if the same EJB is called from the web application, the entity is not returned properly due to this bug GLASSFISH-17432.
The workaround I already found here Calling Remote EJB in EJB 3.1 is not really solving this problem, because if I disable the weaving in EclipseLink, the following does not work any more properly:
@ManyToOne(fetch=FetchType.LAZY)
public Foo getFoo() {
return foo;
}
@ManyToOne(fetch=FetchType.EAGER)
public Bar getBar() {
return bar;
}