Hi, I am facing an issue with detached entities when using EntityManager.clear() operation along with Local EJB. Lets consider the case in which entity is returned from the query and later detached by invoking clear() API:
Parent | |_ Child (LAZY fecthed) implementation of getChild in Parent entity: Child getChild () { if (child == null) { child = new ArrayList....; } return child; } The problem is that when Parent entity is detached through /clear()/ API it is very common that at line when /child /object is returned it is still NULL, regardless the fact that it was initialized a line before. But, when the same entity Parent is getting detached through *serialization*, query exposed as remote EJB, then everything works as expected. After checking an enhanced class it was found out that some state is preserved in StateManager internal class when clear() is invoked but is cleaned-up upon serialization. Please advise if it is a bug or this is how it works in: Local EJB + EntityManager.clear() constellation. -- View this message in context: http://openjpa.208410.n2.nabble.com/EntityManager-clear-doesn-t-totally-detaches-an-entity-tp7582558.html Sent from the OpenJPA Users mailing list archive at Nabble.com.