Moved beginTransaction() and commit() calls to the EntityManager, not deprecated anymore.