title: Am I supposed to call EntityManager.clear() often to avoid memory leaks?
body: <p>I'm new to JPA/OpenJPA and I noticed that if I don't call <code>EntityManager.clear()</code> after i persist entities I get an <code>OutOfMemoryError</code> (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. </p>
  
  <p>So, am I required to explicitly detach the entities myself?
  If I'm not, it's a good practice anyway?</p>