@Entity @Getter public class Member { @Id @GeneratedValue private Long id ; } @SpringBootTest @Rollback (value = false ) class MemberRepositoryTest { @Autowired MemberRepository memberRepository ; @BeforeEach void prepareData () { memberRepository .save( new Member()) ; } @Test @Transactional void findMember () throws InterruptedException { Member findMember = memberRepository .findAll().get( 0 ) ; // Optional<Member> newFindMember = memberRepository.findById(findMember.getId()); // System.out.println("newFindMember.isEmpty() = " + newFindMember.isEmpty()); int threadCount = 1 ; int latchCount = 1 ; ExecutorService service = Executors. newFixedThreadPool (threadCount) ; CountDownLatch countDownLatch = new CountDownLatch(latchCount) ; for ( int i = 0 ; i < latchCount ; i++) { service.execute(() -> { Optional<Member> newFindMember = memberRepository .findById( findMember .getId()) ; System. out .println( "newFindMember.isEmpty() = " + newFindMember.isEmpty()) ; countDownLatch .countDown() ; }) ; } countDownLatch.await() ; } } 위에 처럼 테스트 전에 BeforEach 에서 Member 1건을 생성하고 Thread 환경이라는 전제 하에서 가져오는 부분을 샘플로 짰는데요, 위 코드를 실행하면 궁금한 부분이 2가지 있습니다. 1. findById 를 할 경우 select 쿼리가 실행됩니다. @Transactional 로 선언되어 최초 findAll 에서 가져온 객체들이 영속성 컨텍스트에 남아있을테니 findById 시점에는 영속성컨텍스트의 대상을 가져올 것 같은데 왜 select 쿼리가 실행되는 건가요? 2. findById 를 통해 가져온 대상이 빈객체 입니다. isEmpty 가 true 로 나오는데요, 어찌됐건 DB에서 조회를 해왔을테니 대상을 정상적으로 가져와야 할 것 같은데, 왜 아무것도 가져오지 못하는 건가요? @Transactional 어노테이션을 제거하면 정상적으로 가져 옵니다. Thread 환경이 아닌 일반적인 코드에서는 예상대로 잘 실행이 되는데 Thread 환경에서는 왜 그런지 모르겠네요ㅠ
https://github.com/hwd3004/clone_pinterest 오라클 클라우드로 하고 있고 포트 개방은 80, 443, 8080, 8000, 9000, 3306 해주었습니다. 도커 포테이너 - 서비스에서 django_container_gunicorn이 이상한거 같습니다. 이건 django_container_gunicorn 로그입니다. , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:42:42 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:42:42 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:43 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:44 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:45 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:46 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:47 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:42:58 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:42:58 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:59 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:00 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:01 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:02 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:03 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:43:29 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:43:29 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:30 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:31 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:32 +0000] [1] [ERROR] Retrying in 1 second., , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:43:13 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:43:13 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:14 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:15 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:16 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:17 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:43:18 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), , 0 static files copied to '/home/clone_pinterest/staticfiles', 134 unmodified., Operations to perform:, Apply all migrations: accountapp, admin, articleapp, auth, commentapp, contenttypes, profileapp, projectapp, sessions, subscribeapp, Running migrations:, No migrations to apply., Your models in app(s): 'accountapp' have changes that are not yet reflected in a migration, and so won't be applied., Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them., [2021-06-10 09:42:27 +0000] [1] [INFO] Starting gunicorn 20.1.0, [2021-06-10 09:42:27 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:28 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:29 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:30 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:31 +0000] [1] [ERROR] Retrying in 1 second., [2021-06-10 09:42:32 +0000] [1] [ERROR] Can't connect to ('0.0.0.0/8000', 8000), 이건 서비스 탭에 있는 nginx 로그입니다. /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration, /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/, /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf, 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf, /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh, /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh, /docker-entrypoint.sh: Configuration complete; ready for start up, 2021/06/10 09:30:42 [error] 34#34: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 10.0.0.2 - - [10/Jun/2021:09:30:42 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 2021/06/10 09:30:55 [error] 34#34: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 10.0.0.2 - - [10/Jun/2021:09:30:55 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 10.0.0.2 - - [10/Jun/2021:09:31:09 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 2021/06/10 09:31:09 [error] 34#34: *1 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 2021/06/10 09:32:03 [error] 34#34: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", 10.0.0.2 - - [10/Jun/2021:09:32:03 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 10.0.0.2 - - [10/Jun/2021:09:34:03 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36", 2021/06/10 09:34:03 [error] 34#34: *7 connect() failed (113: No route to host) while connecting to upstream, client: 10.0.0.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.5:8000/", host: "140.83.62.96", /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration, /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/, /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf, 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf, /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh, /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh, /docker-entrypoint.sh: Configuration complete; ready for start up, 2021/06/10 09:30:05 [emerg] 1#1: host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, nginx: [emerg] host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration, /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/, /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh, 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf, 10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf, /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh, /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh, /docker-entrypoint.sh: Configuration complete; ready for start up, 2021/06/10 09:30:21 [emerg] 1#1: host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, nginx: [emerg] host not found in upstream "django_container_gunicorn" in /etc/nginx/nginx.conf:21, 질문이 너무 이상해서 죄송합니다.
아톰 설정 중 이와 관련한 에러에 대한 설명은 웹에서도 제대로 찾지 못해 질문 남깁니다.\ 기존에 뜨던 에러에 대해선 기존 질답을 보고 해결했는데 그 문제를 해결하자 새로 이런 문제가 생겼는데요ㅠㅠ vs code로 강의를 들을 때에도 지장이 없겠죠? 일단 아톰 에러가 난 라인은 아래와 같습니다... Line number: 39
안녕하세요. 좋은 강의와 매번 친절한 답변 덕분에 좋은 환경속에서 공부하고 있습니다. 감사합니다. 질문이 있어서 글을 남깁니다. std::cin.clear(); 의 기능에 대한 질문입니다. 해당 기능은 'cin으로 받은 것 중 버퍼에 쌓인 것을 지워준다.' 로 알고 있습니다. 그런데 아래와 같이 코드를 돌렸을 때 std::cin.clear();를 했음에도 불구하고 버퍼에 아직 쌓여있는것 같아서 이렇게 질문을 남깁니다. ---코드 --- #include <iostream> int main() { using namespace std; int x; int y; int z; // 예시로 123 456 789 를 입력함 cin >> x; std::cin.clear(); //퍼버에 쌓인것을 다 지워준다. // 버퍼에 있는 것을 모두 지웠으니 입력되지 않을 것으로 기대함 cin >> y; cin >> z; cout << x <<" " << y << " " << z <<endl; return 0; } 제가 혹시 잘 못 코딩한거라던지 cin.clear() 의 기능에 대해 잘 못 알고 있는게 있을까요?
질문 1 output.tf의 역할이 state file 에 변수를 저장하는 역할이고 그리고 변수가 잘 저장 되어 있는지 보기 위해서인가요? 질문 2 output 변수명{ } 에서의 변수명은 tf101_availability_zone_names라고 작성하셨습니다. 그리고 terraform.tfvars과 variable.tf 에서는 변수명을 availability_zone_names라고 작성하셧습니다. 편의상 구분을 하기 위해서 tf101_라고 붙이셨다고 하는데 변수를 이름 다르게 저장할 이유가 있는가요? 왜 차이를 두셨나요?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 위 이미지 같이 한번은 이불 밖으로 한번은 이불 안으로 들어가는 손을 작업하기 위해 이불 레이어 기준에서 윗쪽과 아래쪽 레이어 2개를 만들어서 "오른손(1)"의 심볼을 수행한 후 파괴하고 "이불밑_오른손(2)"에서 심볼을 생성하고 수행 했는데요.. 이방법말고 다른 방법이 있는지 질문 드립니다. 그리고 위의 방법에서 "오른손 (1)"의 심볼을 수행한 후 파괴 했자나요? 파괴를 안하고 숨길 수 있는 방법이 있나요? 왜냐하면 심볼을 파괴하고 새로 생성하면 심볼의 크기나 위치를 다시 수정해야 되는 경우가 있어서 불편합니다. +_+; 그럼 오늘도 좋은 하루 보내세요~
안녕하세요, 강사님 DATE_ADD를 이용하여 JOIN하는 Rising Temperature 문제 관련하여 문의드립니다. 풀이에서 전 날의 데이터를 알기 위해 DATE_ADD를 사용하셨는데요, 매일의 날짜가 없는 경우 (1월 2일 데이터가 없는 상태에서 1월 1일, 3일, 4일.... 이렇게 데이터가 있는) 에는 이전의 날짜의 온도와 비교하기 위해서는 어떤 식으로 쿼리를 구성하면 될까요? 쿼리문을 짜보려니 쉽지 않아 힌트라도 얻을 수 있을까하여 질문드립니다!
POST - HTML Form 요청시 content-type이 application/x-www-form-urlencodeed 형식으로 보내면 비록 메세지 바디에 전송되지만 쿼리 파라미터 처럼 @RequestParam 으로 조회 및 @ModelAttribute 와 같이 객체안에 바인딩이 된다고 강조하면서 설명 해주셨는데요 content-type이 form-data 경우에도 동일하게 동작하는데요 이 내용에 대해서는 강의에 없는거 같아서요
Object 클래스의 equals() 메서드도 객체끼리 비교하면 같은 객체인지를 기본적으로(오버라이딩 하지 않았을 때) 객체의 주소로 비교해주니까 isEqualTo가 equals처럼 동작한다면 isSameAs말고 isEqualTo로 비교해도 되지 않나요? (영상 8:36)
처음에 npm run start 입력하니까 콘솔에 log 해서 적어둔 부분이 출력이 안되고 다시 또 명령 입력할 수 있는 > 이 부분이 계속 뜨더라구요. 그래서 hello world 라고 적은 뒤에 부분을 조금 수정해서 저장한 뒤에 다시 npm run start를 하니까 제대로 출력이 되는데 이게 저장하고 안하고의 차이때문에 발생한걸까요??
안녕하세요 Sequence 자료형을 언급하시면서, 메모리를 효율적으로 사용한다고 언급하셨는데 리스트 자료형같은 경우에 변수 선언을 하는 즉시 RAM에 모든 리스트 변수가 올라가는 것이 아닌가요? 그런데 어떻게 iter를 통해서 메모리 효율을 끌어올린다고 하시는건가요? 감사합니다
D:\KAFKA_HOME\confluent-6.1.0>.\bin\windows\connect-distributed.bat .\etc\kafka\connect-distributed.properties [2021-06-10 15:43:28,943] WARN could not get type for name kotlin.jvm.internal.FunctionReference from any class loader (org.reflections.Reflections) org.reflections.ReflectionsException: could not get type for name kotlin.jvm.internal.FunctionReference at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:312) at org.reflections.Reflections.expandSuperTypes(Reflections.java:382) at org.reflections.Reflections.<init>(Reflections.java:140) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader$InternalReflections.<init>(DelegatingClassLoader.java:444) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanPluginPath(DelegatingClassLoader.java:334) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.scanUrlsAndAddPlugins(DelegatingClassLoader.java:268) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initPluginLoader(DelegatingClassLoader.java:216) at org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader.initLoaders(DelegatingClassLoader.java:209) at org.apache.kafka.connect.runtime.isolation.Plugins.<init>(Plugins.java:61) at org.apache.kafka.connect.cli.ConnectDistributed.startConnect(ConnectDistributed.java:91) at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:78) Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.FunctionReference at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:310) ... 10 more 가장 첫번째 오류이고 동일하게 org.reflections.ReflectionsException 해당 Exception이 쭉쭉쭉 발생하고 있습니다. ㅜㅜ