728x90 전체 글87 Singleton 싱글톤 > 인스턴스를 오직 하나만 만들어 제공 > new 를 사용하지 않고 인스턴스를 생성해야함 > Runtime 등... ex) - double checked locking public class SingletonSample { private static volatile SingletonSample instance; private SingletonSample() {} //private로 생성자를 만드는 경우 밖에서 instance를 생성할 수 없음 public static SingletonSample getInstance(){ //해당 static 메서드를 사용해서 사용 가능 if(instance == null){ synchronized (SingletonSample.class){ if(instance.. 2022. 3. 26. The called method's class hierarchy was loaded from the following locations 2022-03-26 18:11:26.326 INFO 17027 --- [ main] c.e.redissample.RedissampleApplication : Starting RedissampleApplication using Java 1.8.0_282 on cheolju.ECM with PID 17027 (/Users/cheolju/IdeaProjects/springbootredis/redissample/target/classes started by cheolju in /Users/cheolju/IdeaProjects/springbootredis/redissample) 2022-03-26 18:11:26.328 INFO 17027 --- [ main] c.e.redissample.RedissampleAp.. 2022. 3. 26. Redis 사용 1. dependency 설정 org.springframework.boot spring-boot-starter-data-redis org.springframework.data spring-data-redis 2.6.1 2. redis 설치 및 실행 terminal > docker run -p 6379:6379 --name redis_boot -d redis > docker exec -i -t redis_boot redis-cli 3. StringRedisTemplate 사용 @Component public class RedisRunner implements ApplicationRunner { @Autowired StringRedisTemplate redisTemplate; @Override publ.. 2022. 3. 26. DBCP DBCP -> DataBase Connection Pool Spring boot 기본값 (기본적으로 HikariCP를 사용함) autoCommit -> 자동커밋 / 기본값 : true idleTimeout -> connection이 pool에서 idle 상태로 있을 수 있는 최대 시간 / 기본값 : 600000(10min) ConnectionTimeout -> DBCP Pool에서 일정 기간동안 전달을 못한경우 Exception을 냄 / 기본값 : 30sec maximumPoolSize -> 커넥션 객체를 몇개를 유지할 것이냐 / 기본값 : 10 minimumIdle -> HikariCP가 pool에서 유자하려고 하는 최소 idle연결 수를 제어 / 기본값 : maximumPoolSize와 동일 keep.. 2022. 3. 26. 이전 1 2 3 4 5 6 7 8 ··· 22 다음 728x90