Let's say I have an EJB for scheduled job.
@Singleton
@Startup
public class MySchedule {
@Schedule
public void doSomething() {
// select oldest 8192 entities (MyEntity.class)
// and process them
entityManager.clear(); // should I do this?
}
@PersistenceContext
private EntityManager entityManager;
}
Is it possible those selected entities are kept in the entityManager
? Should(Ought) I clear it?