Hibernate UnknownServiceException :Unknown service requested as transaction completed

后端 未结 4 1620
滥情空心
滥情空心 2021-02-13 12:40

I have a simple class which starts 3 threads and saves a new object in each thread. But I am getting exception which i cannot understand. Can anyone help me understand why the e

4条回答
  •  北海茫月
    2021-02-13 13:14

    Call .openSession() instead of .getCurrentSession() after getSessionFactory().
    The sessionFactory object is thread-safe but each Session object should be single-threaded.

提交回复
热议问题