As far as I know when I use EntityFetchGroup then although I close entity manager there is anyway a live `session` which is used if I try to get field, that has not been loaded yet. This is a feature of EclipseLink.
I use RMI and send objects from RMI server to RMI client. So, I am sure that I will not call getters of the fields that haven't been loaded. Besides I get exception when trying to send such object from server to client.
java.lang.ClassNotFoundException: org.eclipse.persistence.internal.queries.EntityFetchGroup (no security manager: RMI class loader disabled)
When on server side I print all the fields of the entity (using reflection) I get the following:
So we see that entity has this additional fields that were added via weaving. Could anyone say the proper way to close all these additional objects that I could use before sending object to client?