에러 메세지 org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags: [com.beside.backend.domain.entitiy.wisesaying.WiseSaying.emotionWiseSayingsWords, com.beside.backend.domain.entitiy.wisesaying.WiseSaying.wiseSayingBookmark]; nested exception is java.lang.IllegalArgumentException: org.hibernate.loader.Mult..
1 : N 관계에서 Fecth Join 사용시 발생하는 MultipleBagFetchException 해결법 1. ToOne(OneToOne, ManyToOne) 관계를 모두 Fetch Join 한다. 2. 1:N 관계의 Collection Entity는 Lazy Loading(지연 로딩)으로 조회한다. 3. Lazy Loading(지연 로딩) 성능 최적화를 위해 hibernate.default_batch_fetch_size를 적용한다. * QueryDsl 에서도 1:N 관계에서 단 한번의 fetch join 사용해야 하는 건 똑같다. ToOne(OneToOne, ManyToOne) 관계를 모두 Fetch Join 한다. 연관관계에서 자식 테이블인 ToOne 관계에서는 row 수를 증가시키지 않는다. 따..
- Total
- Today
- Yesterday
- port
- Git
- JPA
- array
- dto 클래스 생성자
- insertMany
- Cannot construct instance of
- Java
- junit5
- QueryDSL
- 배열
- checkout
- Linux
- 문자열계산기
- ?.let
- ChatGPT
- Kotlin
- n+1
- MultipleBagFetchException
- Spring Security
- FetchJoin
- addFilterBefore
- insertOne
- 장애 대응
- document insert
- spring boot 3
- java.lang.NullPointerException: Parameter specified as non-null is null
- MongoDB
- 스프링오류
- 추상클래스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |