Spring/error log

org.hibernate.LazyInitializationException: could not initialize proxy [com.codiary.backend.global.domain.entity.Member#3] - no Session at

melitina 2024. 8. 10. 18:49

https://cantcoding.tistory.com/78

 

JPA/ could not initialize proxy - no Session

1.문제점 JPA를 통한 개발을 하다보면 한번쯤 만날 수 밖에없는 에러이다. JPA를 사용하여 DB에 저장된 리소스를 불러와서 반환하는 경우, 혹은 사용할 때 발생했던 에러이다. 2.접근 JPA에 대한 이

cantcoding.tistory.com

 

https://byungil.tistory.com/241

 

JPA Error: 흔히 접할 수 있는 에러 could not initialize proxy - no Session

JPA Error: could not initialize proxy - no Session 접근 JPA강의에서 분명히 이거에 대한 내용을 다뤘던 거 같은데 기억이 안난다.. 영속성 컨텍스트, Proxy, Lazy Loading에 대한 이해가 필요함. Lazy Loading 내용은

byungil.tistory.com

 

 

 

@ManyToOne한 테이블 Member에서 memberId는 괜찮았지만 nickname이 안가져와지는 에러

 

트랜잭션과 관련됨

DTO 변환을 Controller에서 Service로 변경하도록 한다

 

 

 

번외

https://velog.io/@yarogono/JPA-could-not-initialize-proxy-no-Session-%EC%97%90%EB%9F%AC

 

[JPA] could not initialize proxy - no Session 에러

JPA를 사용하면서 자주 접하는 에러이다. 쉽게 해결하고 넘어갈 수 있는 내용이지만, 파고 공부하면 얻을게 상당히 많아서 글로 작성해봤다. 글을 통해 JPA와 더 친해져보자.

velog.io

 

JPQL 이용

EAGER

등등