use threadlocal to set the EntityManager