Marcelo Zambiasi wrote:Yes... it's possible, but you must have an active transaction to change the "database" of EJB3Unit. Something like that: EntityManager em = this.getEntityManager(); em.getTransaction().begin(); //your code with em.persist() ... ... //end your persistence code em.getTransaction().commit();