|
| Re: entity.getAlist() reopen de emFactory and entityManager that was previously closed!! [message #528141 is a reply to message #527533] |
Mon, 19 April 2010 10:03   |
James Sutherland Messages: 1834 Registered: July 2009 |
Senior Member |
|
|
EclipseLink does support access to LAZY relationships after the EntityManager has been closed. This is undefined in the JPA spec, but it a very desirable feature.
I'm not sure what you mean by detach, if you serialize the object, it will not be able to access LAZY relationships.
If you close the EntityManagerFactory, I would expect an error, this is odd. Is there something else holding onto the same EntityManagerFactory? If there is, then close will not actually close it.
James : Wiki : Book : Blog
|
|
|
| Re: entity.getAlist() reopen de emFactory and entityManager that was previously closed!! [message #528249 is a reply to message #528141] |
Mon, 19 April 2010 15:41   |
No real name Messages: 7 Registered: April 2010 |
Junior Member |
|
|
Thanks for the answer James!
For detach I mean call the detach() method from entityManager.
I don't know if there are something holding the EntityManagerFactory but before close I call entityManager.clear() to detach all entities and after I test if the EntityManagerFactory is open:
emf.isOpen();
and the return is false.
But even now my entity can load the lazy associations creating a new connection and doing the queries. This isn't a problem for me, but open a opportunity to the programmer work in an inappropriate way.
[Updated on: Mon, 19 April 2010 16:07] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01529 seconds