extend « EntityManager « JPA Q&A





1. Why do we have to manually flush() the EntityManager in a extended PersistenceContext?    stackoverflow.com

In our J2EE application, we use a EJB-3 stateful bean to allow the front code to create, modify and save persistent entities (managed through JPA-2). It looks something like this:

@LocalBean
@Stateful
@TransactionAttribute(TransactionAttributeType.NEVER)
public class MyEntityController ...