I'm new to JPA/OpenJPA and I noticed that if I don't call EntityManager.clear()
after i persist entities I get an OutOfMemoryError
(I keep adding new entities in a loop). I'm not sure if this is the expected behavior or it's just and OpenJPA 1.2.1 glitch.
So, am I required to explicitly detach the entities myself? If I'm not, it's a good practice anyway?