안녕하세요. 강의 잘 듣고 있습니다. 강의 중에 궁금한 내용이 있어서 질문드립니다. JobExecutionDecider 강의에 있는 예제 코드를 보면 ODD와 EVEN 처리를 위해 아래처럼 next(), from(), from() 을 사용하고 있는데요, 이걸 아래처럼 next(), from() 으로만 사용해도 문제가 없을까요? decider()호출이 계속 중복되어 아래처럼 수정을 했는데 일단 테스트는 잘 수행되었습니다. 혹시 제가 모르는 다른 부분이 있을지 궁금하여 질문드립니다.
[C++과 언리얼로 만드는 MMORPG 게임 개발 시리즈] Part1: C++ 프로그래밍 입문
안녕하세요 선생님 강의 33분쯤 내용에 대한 질문입니다! delete k; 에 따라서 k주소의 데이터가 모두 삭제되면 job() 함수를 실행하였을때, this 포인터의 주소를 거치기 때문에 이미 삭제된 엉뚱한 메모리를 건드리는 것이 위험하다는 부분은 잘 이해를 했습니다.. 그렇다면 이미 선언된 job() 함수를 없애는 방법은 없을까요? 나름 고민해서 k = nullptr 를 해봐도 이미 ResetHpJob()의 주소가 job에 저장돼서 안되는거 같더라구요.. 캡처에 this를 표기함으로 위험성을 잘 인지할 수 있다는 것은 이해했지만, 저러한 상황이 왔을 때, 위험한 함수(job)를 아예 제거하는 방법은 없을지 궁금합니다! 만약 제거가 힘들다면 if(k){job()} 와 같은 방식으로 코드를 설계하는 방법이 좋아보이는데,, 혹시 다른 좋은 방법이 있을지도 궁금합니다!
한국은 천 단위를 ,로 구분합니다 선생님! 제가 알기로 .로 구분하는 거는 스페인 쪽인데 거주하시는 미국에서도 .단위를 쓰시나요? 그리고 매달 1,000,000 함수 호출 시 무료보다 매달 1,000,000건의 함수 호출까지 무료 라고 써주시면 더 이해가 잘 갔을 것 같습니다!
출력한 구구단을 입력 받은 후에 그 입력 받은 단 보다 1,2단씩 큰 단을 출력하는 문제인데 제가 쓴 코드가 일단 저기까지 써서 일반적인 구구단 출력까진 하겠는데 1,2단씩 큰 단을 어떻게 출력하는질 모르겠어서 ... 도와주실 분 계실까요 int i,dan; printf("단을 입력하세요 :"); scanf("%d", &dan); for(i=1; i<=9; i++){ printf("%d * %d = %d\n" , dan, i, dan * i); // 일반적인 구구단 } return 0; }
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는아니 강사님 왜 자꾸 어어 거려요? 진짜 겁나 거슬려 죽겠네 ㅡㅡ 어좀 적당히해요 거슬려 죽겠네 그리고 마이크 좀 좋은거 쓰세요 볼륨이 낮아졌다 커졌ㄷ ㅏ하고 발음도 다뭉개져지고 딕션도 안 좋아서 하나도 안들려요 진짜 개짜증나네아니 강사님 왜 자꾸 어어 거려요? 진짜 겁나 거슬려 죽겠네 ㅡㅡ 어좀 적당히해요 거슬려 죽겠네 그리고 마이크 좀 좋은거 쓰세요 볼륨이 낮아졌다 커졌ㄷ ㅏ하고 발음도 다뭉개져지고 딕션도 안 좋아서 하나도 안들려요 진짜 개짜증나네아니 강사님 왜 자꾸 어어 거려요? 진짜 겁나 거슬려 죽겠네 ㅡㅡ 어좀 적당히해요 거슬려 죽겠네 그리고 마이크 좀 좋은거 쓰세요 볼륨이 낮아졌다 커졌ㄷ ㅏ하고 발음도 다뭉개져지고 딕션도 안 좋아서 하나도 안들려요 진짜 개짜증나네아니 강사님 왜 자꾸 어어 거려요? 진짜 겁나 거슬려 죽겠네 ㅡㅡ 어좀 적당히해요 거슬려 죽겠네 그리고 마이크 좀 좋은거 쓰세요 볼륨이 낮아졌다 커졌ㄷ ㅏ하고 발음도 다뭉개져지고 딕션도 안 좋아서 하나도 안들려요 진짜 개짜증나네아니 강사님 왜 자꾸 어어 거려요? 진짜 겁나 거슬려 죽겠네 ㅡㅡ 어좀 적당히해요 거슬려 죽겠네 그리고 마이크 좀 좋은거 쓰세요 볼륨이 낮아졌다 커졌ㄷ ㅏ하고 발음도 다뭉개져지고 딕션도 안 좋아서 하나도 안들려요 진짜 개짜증나네아니 강사님 왜 자꾸 어어 거려요? 진짜 겁나 거슬려 죽겠네 ㅡㅡ 어좀 적당히해요 거슬려 죽겠네 그리고 마이크 좀 좋은거 쓰세요 볼륨이 낮아졌다 커졌ㄷ ㅏ하고 발음도 다뭉개져지고 딕션도 안 좋아서 하나도 안들려요 진짜 개짜증나네 1:1 문의하기를 이용해주세요.
안녕하세요! 본격적인 강의 듣기 전에 교안부터 학습 중입니다. 궁금한 것 질문 드립니다. 5. int, 4바이트짜리 정수 1."int는 ... 20억까지 표현할 수 있습니다" 2."int의 최대값으로 987654321 또는 1e9를 씁니다." - 알고리즘 교안 18page 2번째 문장이 이해가 안되는데요. const int INF = 987654321; 20억까지 표현 가능한데 왜 약 10억 정도로 최대값을 정의하는 건가요? 감사합니다!
선생님 공부하다가 제 머리로는 이해 안되는게 생겼습니다 약 7분 29초 이고 for문 안에 if 문이 있는데 for s in os.path.sep, os.path.altsep: if s: 위와 같이 if s: 이렇게 되어있는데 if문을 왜 쓴걸까요? s는 무조건 존재하기때문에 무조건 참이 나올수밖에 없는 상황인데 해당 코드가 왜 들어갔는지 잘 모르겠어요 뭔가 심오한 뜻이 있을거 같은데 알려주시면 감사하겠습니다
강사님 강의 내용과 똑같은 코드를 작성했으나 오류가 계속 생성됬는데 어찌저찌 풀어서 참고하실 분들을 위해 남깁니다 제가 오류가 발생한 상황(hoc/auth.js) [강사님과 같은 코드를 작성 후 서버/클라이언트 실행 시 빈 화면이 나옴] (오류 내용 : unctions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.) - 해결책 : AuthenticationCheck 리턴 시 함수로 리턴하는 것이 아닌 JSX 컴포넌트로 리턴하라고 합니다 (참고 : https://www.inflearn.com/questions/357383) - 실제로 auth.js의 마지막 부분인 을 return AuthenticationCheck -> return < AuthenticationCheck />로 변경 시 정상적으로 작동함을 확인할 수 있었습니다. [hoc/auth.js 코드] import React, { useEffect } from "react"; import { useDispatch } from "react-redux"; import { auth } from "../_action/user_action"; import { useNavigate } from "react-router-dom"; export default function (SpecificComponent, option, adminRoute = null) { //option : null = anyone, true = login user only, false = logout user only function AuthenticationCheck(props) { const dispatch = useDispatch(); const navigate = useNavigate(); useEffect(() => { dispatch(auth()).then((response) => { console.log("auth? ", response); if (!response.payload.isAuth) { // login yet if (option) { navigate("/login"); } } else { // login if (adminRoute && !response.payload.isAdmin) { navigate("/"); } else { if (option === false) { navigate("/"); } } } }); }, []); return ( <SpecificComponent /> // component return이 없으면 React 실행이 안됨. ); } return <AuthenticationCheck />; }
@Entity @Getter @Setter public class Category { @Id @Column ( name = "CATEGORY_ID" ) @GeneratedValue ( strategy = GenerationType . IDENTITY ) private Long id ; private String name ; @ManyToOne ( fetch = FetchType . LAZY ) @JoinColumn ( name = "MEMBER_ID" ) private Member member ; @ManyToOne ( fetch = FetchType . LAZY ) @JoinColumn ( name = "PARENT_ID" ) private Category parent ; @OneToMany ( mappedBy = "parent" , cascade = CascadeType . ALL ) private List < Category > child = new ArrayList < > ( ) ; } @Repository public class CategoryRepository { private final EntityManager em ; public List < Category > findAll ( ) { return em . createQuery ( "select c from Category c" , Category . class ) . getResultList ( ) ; } } @Service @Transactional @RequiredArgsConstructor public class CategoryService { private final CategoryRepository categoryRepository ; @Transaction <-- 이부분 //@Transaction(readOnly=true) <-- 이부분 public List < Category > findAll() { return categoryRepository . findAll ( ) ; } } @RestController @RequiredArgsConstructor public class CategoryApiController { private final CategoryService categoryService; private final CategoryRepository categoryRepository; private final MemberService memberService; @GetMapping("/api/v1/categories") public Result getCategory(@RequestParam(required = false, value = "id") String memberId){ List < Category > categories = categoryService.findAll(); <-- 이부분 // List < Category > categories = categoryRepository.findAll(); <-- 이부분 List < CategoryDto > categoryDtos = categories.stream() .map(c -> new CategoryDto(c)) .collect(Collectors.toList()); return new Result(categoryDtos.size(), categoryDtos); } @Data @AllArgsConstructor static class CategoryDto{ public CategoryDto(Long id, String name) { this.id = id; this.name = name; } public CategoryDto(Category category) { this.id = category.getId(); this.name = category.getName(); this.child = category.getChild().stream() .map(c -> new CategoryDto(c.getId(),c.getName())) .collect(Collectors.toList()); } private Long id; private String name; private List < CategoryDto > child; private Long parentId; } } categoryRepository.findAll()를 호출 했을 때 2022-05-12 23:35:46.474 DEBUG 18928 --- [nio-9090-exec-2] o.j.s.OpenEntityManagerInViewInterceptor : Opening JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-05-12 23:35:46.527 INFO 18928 --- [nio-9090-exec-2] p6spy : #1652366146527 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select category0_.category_id as category1_0_, category0_.member_id as member_i3_0_, category0_.name as name2_0_, category0_.parent_id as parent_i4_0_ from category category0_ select category0_.category_id as category1_0_, category0_.member_id as member_i3_0_, category0_.name as name2_0_, category0_.parent_id as parent_i4_0_ from category category0_; 2022-05-12 23:35:46.539 INFO 18928 --- [nio-9090-exec-2] p6spy : #1652366146539 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id in (?, ?, ?, ?, ?, ?, ?, ?) select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id in (6, 7, 8, 9, 10, 11, 12, 13); 2022-05-12 23:35:46.566 DEBUG 18928 --- [nio-9090-exec-2] o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor categoryService.findAll() 을 호출 했을 때 1)@Transaction(readOnly = true) 2022-05-12 23:31:45.235 DEBUG 18388 --- [nio-9090-exec-1] o.j.s.OpenEntityManagerInViewInterceptor : Opening JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-05-12 23:31:45.258 DEBUG 18388 --- [nio-9090-exec-1] o.s.orm.jpa.JpaTransactionManager : Found thread-bound EntityManager [SessionImpl(72969494<open>)] for JPA transaction 2022-05-12 23:31:45.258 DEBUG 18388 --- [nio-9090-exec-1] o.s.orm.jpa.JpaTransactionManager : Creating new transaction with name [com.blog.demo.service.CategoryService.findAllRootCategories]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly 2022-05-12 23:31:45.261 DEBUG 18388 --- [nio-9090-exec-1] o.s.orm.jpa.JpaTransactionManager : Exposing JPA transaction as JDBC [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@675de2b1] 2022-05-12 23:31:45.292 INFO 18388 --- [nio-9090-exec-1] p6spy : #1652365905292 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select category0_.category_id as category1_0_, category0_.member_id as member_i3_0_, category0_.name as name2_0_, category0_.parent_id as parent_i4_0_ from category category0_ select category0_.category_id as category1_0_, category0_.member_id as member_i3_0_, category0_.name as name2_0_, category0_.parent_id as parent_i4_0_ from category category0_; 2022-05-12 23:31:45.301 DEBUG 18388 --- [nio-9090-exec-1] o.s.orm.jpa.JpaTransactionManager : Initiating transaction commit 2022-05-12 23:31:45.301 DEBUG 18388 --- [nio-9090-exec-1] o.s.orm.jpa.JpaTransactionManager : Committing JPA transaction on EntityManager [SessionImpl(72969494<open>)] 2022-05-12 23:31:45.301 INFO 18388 --- [nio-9090-exec-1] p6spy : #1652365905301 | took 0ms | commit | connection 1| url jdbc:h2:tcp://localhost/~/blog ; 2022-05-12 23:31:45.302 DEBUG 18388 --- [nio-9090-exec-1] o.s.orm.jpa.JpaTransactionManager : Not closing pre-bound JPA EntityManager after transaction 2022-05-12 23:31:45.303 INFO 18388 --- [nio-9090-exec-1] p6spy : #1652365905303 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id in (?, ?, ?, ?, ?, ?, ?, ?) select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id in (6, 7, 8, 9, 10, 11, 12, 13); 2022-05-12 23:31:45.329 DEBUG 18388 --- [nio-9090-exec-1] o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor 2)@Transaction 2022-05-12 23:37:14.348 DEBUG 19206 --- [nio-9090-exec-2] o.j.s.OpenEntityManagerInViewInterceptor : Opening JPA EntityManager in OpenEntityManagerInViewInterceptor 2022-05-12 23:37:14.369 DEBUG 19206 --- [nio-9090-exec-2] o.s.orm.jpa.JpaTransactionManager : Found thread-bound EntityManager [SessionImpl(1468362384 < open > )] for JPA transaction 2022-05-12 23:37:14.369 DEBUG 19206 --- [nio-9090-exec-2] o.s.orm.jpa.JpaTransactionManager : Creating new transaction with name [com.blog.demo.service.CategoryService.findAllRootCategories]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 2022-05-12 23:37:14.371 DEBUG 19206 --- [nio-9090-exec-2] o.s.orm.jpa.JpaTransactionManager : Exposing JPA transaction as JDBC [org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle@4209a22e] 2022-05-12 23:37:14.402 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234402 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select category0_.category_id as category1_0_, category0_.member_id as member_i3_0_, category0_.name as name2_0_, category0_.parent_id as parent_i4_0_ from category category0_ select category0_.category_id as category1_0_, category0_.member_id as member_i3_0_, category0_.name as name2_0_, category0_.parent_id as parent_i4_0_ from category category0_; 2022-05-12 23:37:14.414 DEBUG 19206 --- [nio-9090-exec-2] o.s.orm.jpa.JpaTransactionManager : Initiating transaction commit 2022-05-12 23:37:14.414 DEBUG 19206 --- [nio-9090-exec-2] o.s.orm.jpa.JpaTransactionManager : Committing JPA transaction on EntityManager [SessionImpl(1468362384 < open > )] 2022-05-12 23:37:14.418 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234418 | took 0ms | commit | connection 1| url jdbc:h2:tcp://localhost/~/blog ; 2022-05-12 23:37:14.419 DEBUG 19206 --- [nio-9090-exec-2] o.s.orm.jpa.JpaTransactionManager : Not closing pre-bound JPA EntityManager after transaction 2022-05-12 23:37:14.420 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234420 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=6; 2022-05-12 23:37:14.421 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234421 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=7; 2022-05-12 23:37:14.423 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234423 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=8; 2022-05-12 23:37:14.424 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234424 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=9; 2022-05-12 23:37:14.424 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234424 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=10; 2022-05-12 23:37:14.424 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234424 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=11; 2022-05-12 23:37:14.425 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234425 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=12; 2022-05-12 23:37:14.425 INFO 19206 --- [nio-9090-exec-2] p6spy : #1652366234425 | took 0ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/blog select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=? select child0_.parent_id as parent_i4_0_1_, child0_.category_id as category1_0_1_, child0_.category_id as category1_0_0_, child0_.member_id as member_i3_0_0_, child0_.name as name2_0_0_, child0_.parent_id as parent_i4_0_0_ from category child0_ where child0_.parent_id=13; 2022-05-12 23:37:14.456 DEBUG 19206 --- [nio-9090-exec-2] o.j.s.OpenEntityManagerInViewInterceptor : Closing JPA EntityManager in OpenEntityManagerInViewInterceptor 안녕하세요. 좋은 강의 감사합니다. 강의에서 Order로 api를 만들어주셔서 저는 개인적으로 Category에 대해서 api를 간단하게 만들어보면서 테스트를 몇가지 진행했었는데요. Controller에서 Category의 child를 지연로딩을 통해서 가져올 때 아래 세가지의 경우에 따라 쿼리문이 달라지는 현상을 겪었습니다. 위 코드에서 `<-- 이부분` 으로 표시된 부분을 참고해주시면 감사하겠습니다. 1. Repository로 최초에 Category를 가져올 때에는 in 쿼리가 잘 나갔고, 2. Controller에서 Service로 최초에 Category를 가져올 때는 Service의 해당 메소드에 @Transaction 일떄에는 N+1 문제가 발생하고 3. readOnly=true 일때에는 in 쿼리로 잘 가지고 오는데 이 상황에대해서 이해가 잘 되지 않아 질문 드리게 됐습니다. 3가지 상황 모두 OSIV가 켜져있고, default_batch_fetch_size: 100인 상황입니다. 각각 상황에 대해서 왜 in 쿼리가 나가고 안나가는지에 대해서 설명해주실 수 있을까요? 감사합니다. Repository와 Service차이의 경우 OSIV가 켜져있기 때문에 Controller에 돌아와서도 영속성 컨텍스트가 유지되는게 동일 할텐데 왜 쿼리 차이가 있는지 모르겠고 readOnly=true인 경우, 영속성 컨텍스트의 내용을 플러시하지 않는 것으로 알고있는데 플러시 여부와 지연로딩시 쿼리가 다르게 나가는 것은 상관이 없을 것 같은데 왜 차이가 나는지 파악이 안되고 있습니다. * 트랜잭션 로그를 찍어보니 Repository에서는 transaction을 생성하지 않고 트랜잭션없는 읽기를 진행하는 것으로 보이고 Service에서는 readOnly인 트랜잭션을 생성하냐/아니냐의 차이로 보입니다.
안녕하세요. 강사님. 동적 쿼리 작성을 위해 SearchCondition 방식을 팁으로 알려주셨는데요. SearchCondition 과 엔티티의 필드가 1:1 로 이루어져야 동적 쿼리 작성에 유용할거 같은데 SearchCondition -> BooleanBuilder 로 변환해야되고 이 과정에서 메모리 사용량이 많아질거 같은데요. SearchCondition 적용하므로 인한 메모리 이슈등은 없었는지요? 해당 이슈를 방지할수 있는 팁이 좀 더 있을까요?^^