You don't need to instantiate the EntityManager by hand, your container does that for you because of the
@PersistenceContext annotation. Also, you don't need to begin the transaction manually, it's also provided by your containter. Just use your em field and forget about the other ones.