해당 글은 아래 스프링 공식문서를 바탕으로 정리한 글입니다.https://spring.io/blog/2025/12/18/next-level-kotlin-support-in-spring-boot-4 Next level Kotlin support in Spring Boot 4Following the announcement of the strategic partnership between JetBrains and Spring in May, I would like to share a global update on various Kotlin-related features and documentation enhancements we have made recently, with the goal of making Sp..
Spring RestClient 설정, 구성 요소와 주요 옵션에 대해 정리한 글입니다.해당 글은 Apache HttpClient 5를 기반으로 하여 Timeout, Connection Pooling 에 대해 설명합니다.Dependencyimplementation("org.apache.httpcomponents.client5:httpclient5:5.5") RestClient.BuilderRestClient.Builder를 Bean으로 등록하여 애플리케이션 전반에서 공통된 설정을 가진 RestClient를 쉽게 생성해서 사용할 수 있습니다. Connection & Request Factory 생성HttpComponentsClientHttpRequestFactory를 생성하여 Spring RestClient..
목표jdbcTemplate.batchUpdate 를 이용해 batch upsert 처리하기각 데이터 타입(int, long, double, string, text[], jsonb) 안전하게 처리하기NULL 처리 대량의 데이터를 Insert/Update 해야 할 때 가장 많이 사용하는 방법 중 하나가 JdbcTemplate.batchUpdate() 이다.특히 PostgreSQL을 사용할 경우 UPSERT(ON CONFLICT … DO UPDATE) 기능과 함께 사용하면,대량 데이터 upsert 작업을 매우 효율적으로 처리할 수 있다. Spring Boot Bulk Insert 성능 비교 JPA vs JDBC 하지만 Spring에서 JbdcTemplate으로 batch 작업을 처리할 때 신경써야하는 부분이 ..
문제 상황JPA를 사용하다 보면 다음과 같은 예외를 마주할 때가 있다ObjectOptimisticLockingFailureExceptionStaleObjectStateException 이는 Hibernate가 엔티티를 저장(merge, update)하려고 시도했지만, DB에 해당 데이터가 이미 다른 트랜잭션에서 수정되었거나 삭제된 경우 발생하는 예외이다. 즉, “DB의 상태와 JPA의 엔티티 상태가 불일치할 때” 발생한다. 원인: saveAll()의 내부 동작 방식public List saveAll(Iterable entities) { List result = new ArrayList(); for (S entity : entities) { result.add(save(entity..