사용법 초기설정 @SpringBootApplication @EnableAsync public class SpringplaygroundApplication { public static void main(String[] args) { SpringApplication.run(SpringplaygroundApplication.class, args); } } 첫 번째로 @EnableAsync을 설정해야 한다. 그래야 비동기로 동작하는 데 필요한 Bean 들이 등록이 된다. 돌리고자 하는 클래스 또는 메소드 @Slf4j @Service @Async public class AsyncService { public void myAsyncCall() throws InterruptedException { Thread.sle..
사용법 @EnableScheduling 설정 반드시 @Scheduled를 사용할려면 @EnableScheduling을 다음과 같이 설정해야 한다. @SpringBootApplication @EnableScheduling public class SpringplaygroundApplication { public static void main(String[] args) { SpringApplication.run(SpringplaygroundApplication.class, args); } } @Scheduled 사용 @Scheduled는 다음 아래와 같이 3가지 설정을 통해 구현할 수 있으며, 원하는 내용에 어노테이션을 설정하면 된다. cron cron은 흔히 우리가 linux에서 설정하는 cron 형식과 유..
Bean Prototype Scope 싱글톤 방식으로 동작하는 것이 아닌, bean deployment의 prototype의 범위는 해당 특정 Bean에 대한 요청이 이루어질 때마다 새로운 Bean 인스턴스가 생성(즉, 다른 Bean에 주입되거나 컨테이너의 programmatic getBean() method 호출을 통해 요청됨) 원칙적으로 stateful 한 모든 Bean에는 prototype scope 을 사용하고, stateless Bean에는 singleton scope을 사용해야 한다. 프로토 타입을 사용하고자 할 때, bean의 lifecycle의 미묘한 변화을 알아야 한다. 컨테이너는 프로토타입 객체를 인스턴스화, 구성, 장식 및 조립하고 Client에게 전달한 후 해당 prototype 인..
정적 타입 지정 언어 코틀린은 자바와 마찬가지로 정적 타입 지정 언어다. 추가적으로 코틀린은 변수의 타입을 자동으로 알아내는 경우가 있는데 이를 타입추론 이라고 한다. 정적 타입 지정의 장점 성능: 실행 시점에 어떤 메서드를 호출할 지 알아내는 과정이 필요 없으므로 메서드 호출이 더 빠르다. 신뢰성: 컴파일러가 프로그램의 정확성을 검증하기 때문에 실행 시 프로그램이 오류로 중단될 가능성이 더 적어진다. 유지 보수성: 코드에서 다루는 객체가 어떤 타입에 속하는지 알 수 있기 때문에 처음 보는 코드를 다룰 때도 더 쉽다. 도구 지원: 정적 타입 지정을 활용하면 더 안전하게 리팩토링 할 수 있고, 도구는 더 정확한 코드 완성 기능을 제공할 수 있으며, IDE의 다른 지원 기능도 더 잘 만들 수 있다. Pyth..

getConnection public Connection getConnection(final long hardTimeout) throws SQLException { suspendResumeLock.acquire(); final long startTime = currentTime(); try { long timeout = hardTimeout; do { PoolEntry poolEntry = connectionBag.borrow(timeout, MILLISECONDS); if (poolEntry == null) { break; // We timed out... break and throw exception } final long now = currentTime(); if (poolEntry.isMarked..

HikariPool 생성자 super(config); this.connectionBag = new ConcurrentBag(this); this.suspendResumeLock = config.isAllowPoolSuspension() ? new SuspendResumeLock() : SuspendResumeLock.FAUX_LOCK; this.houseKeepingExecutorService = initializeHouseKeepingExecutorService();super(this) HikariPool은 PoolBase를 상속받아 구현한 클래스로서 기본 값을 설정합니다. PoolBase(final HikariConfig config) { this.config = config; this.network..
HikariDataSource getConnection() isClosed if (isClosed()) { throw new SQLException("HikariDataSource " + this + " has been closed."); } private final AtomicBoolean isShutdown = new AtomicBoolean(); Determine whether the HikariDataSource has been closed. Returns: true if the HikariDataSource has been closed, false otherwise public boolean isClosed() { return isShutdown.get(); } isClosed는 커넥션 풀이 닫..

설정값은 어떻게 처리되나? application.properties 혹은 application.yml 의 값들은 어떻게 처리되는 것일까? 해당 내용을 자세히 확인해보고 싶으면 HikariConfig 을 참조 해주세요. 자주 쓰이는 값들 ✔autoCommit // Properties NOT changeable at runtime // private boolean isAutoCommit; public HikariConfig() { dataSourceProperties = new Properties(); healthCheckProperties = new Properties(); isAutoCommit = true; String systemProp = System.getProperty("hikaricp.conf..
- Total
- Today
- Yesterday
- postgres
- 프로그래머스
- docker
- headers
- 그래프
- 자바
- Python
- setattr
- Command Line
- Pattern
- dockerignore
- Java
- django
- docker-compose
- 2021 KAKAO BLIND RECRUITMENT
- 면접
- 알고리즘
- ubuntu
- Linux
- Spring
- thread
- BFS
- env
- PostgreSQL
- 카카오
- Celery
- 백준
- Collections
- 파이썬
- DRF
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |