I\'m trying to create a multithreading server. The problem is that I get the following error: play.exceptions.JPAException: The JPA context is not initialized. JPA Entit
class Runner extends Runnable {
@Override
public void run() {
EntityManager em = JPA.newEntityManager();
em.setFlushMode(FlushModeType.COMMIT);
JPA jpa = new JPA();
jpa.bindForCurrentThread(JPA.DEFAULT, em, false);
em.getTransaction().begin();
// ... DO YOUR STUFF HERE ...
em.getTransaction().commit();
}
}