I'm trying to implement a nightly job via the org.jboss.varia.scheduler.Scheduler mbean that requires access to the database. I'm unsure about the correct way to obtain a reference to the database/EntityManager.
If I try
EntityManagerFactory emf = Persistence
this.em = emf.createEntityManager();
I get errors about there not being a transaction...
What is the correct way to do this?
Retrieving data ...