I have 2 physical servers which my web application hits managed by load balancers. I always get -
org.hibernate.LazyInitializationException: could not initia
From the tags you provided, I deduce you ran into this problem using Spring Framework. I ran into the same LazyInitializationException
while using a Spring Data org.springframework.data.jpa.repository.JpaRepository
.
I solved the problem by annotating the method which indirectly uses Hibernate to retrieve data from the database with @Transactional
.