How frequently should I create an EntityManager?

后端 未结 3 916
陌清茗
陌清茗 2020-12-30 21:21

I have an EntityManagerFactory for which I can create one (or multiple) EntityManager instances. I\'m using a Servlet environment, and I\'ve got on

3条回答
  •  迷失自我
    2020-12-30 21:31

    Yes, I agree with NimChimpsky and Qwerky to use EJB3.x when accessing DBs and to use one EM per unit of work.

提交回复
热议问题