org.hibernate.LazyInitializationException: could not initialize proxy - no Session

前端 未结 4 493
慢半拍i
慢半拍i 2020-12-31 12:17

I have 2 physical servers which my web application hits managed by load balancers. I always get -

org.hibernate.LazyInitializationException: could not initia

4条回答
  •  独厮守ぢ
    2020-12-31 12:40

    Your object is detached. You need to re-attach it to the current session before accessing it:

    session.update(object);
    

    Also make sure you access it within a transaction

    Read more about the problem/solution here

提交回复
热议问题