본문 바로가기

전체 글144

(취업스터디 1일차) OOP 와 REST API 0. 질문 1) 객체지향 프로그래밍(OOP)에 대해 설명해주세요. 알고있는 원칙이나 키워드를 언급해주세요. > 객체지향 프로그래밍은 프로그래밍에서 필요한 데이터를 추상화 시켜 상태와 행위를 가진 객체를 만들고 그 객체들간의 유기적인 상호작용을 통해 로직을 구성하는 프로그래밍 방법입니다. 5대 원칙으로 단일 책임, 개방 폐쇄, 인터페이스 분리, 리스코프 치환, 의존 역전 원칙이 있습니다. 메인 키워드로 추상화, 캡슐화, 상속, 다형성 그리고 객체 , 클래스, 인스턴스가 있음을 말씀드립니다. 2) REST API란 무엇인가요? 프로젝트에 REST API를 사용한 이유가 무엇인가요? REST API 말고 다른 비교할 만한 것을 알고 있나요? > REST API란 REST 원리를 따르는 API를 의미합니다. R.. 2023. 5. 8.
영속성 문제 1. 책 주문 하기 코드 public ResponseEntity bookdemand(Long bookId, Integer quantity, HttpServletRequest request) { final String lockname = bookId + "lock"; final RLock lock = redissonClient.getLock(lockname); HttpSession session = request.getSession(false); if (session == null) { return BaseResponse.toResponseEntity(ErrorCode.Forbidden); } else { try{ if (!lock.tryLock(1,3, TimeUnit.SECONDS)){ System.o.. 2023. 4. 20.
Github action 빌드 시 dependencies 에러 1. 에러 상황 Welcome to Gradle 7.6.1! Here are the highlights of this release: - Added support for Java 19. - Introduced `--rerun` flag for individual task rerun. - Improved dependency block for test suites to be strongly typed. - Added a pluggable system for Java toolchains provisioning. For more details see https://docs.gradle.org/7.6.1/release-notes.html To honour the JVM settings for this build .. 2023. 4. 20.
Redisson 분산락 사용시 발생하는 문제 1. 발생한 문제 @Transactional public void testbookorder(Long bookid, Integer quantity, Member member) { final String lockname = bookid + ":lock"; final RLock lock = redissonClient.getLock(lockname); try { if (!lock.tryLock(3, 1, TimeUnit.SECONDS)) { throw new RuntimeException("Rock fail"); } Thread.sleep(10); Book book = bookRepository.findById(bookid).orElseThrow( () -> new CustomException(ErrorCode.. 2023. 4. 20.