| 제목 | [WARN] HHH10001002: Using built-in connection pool (not intended for production use) | ||||||
| 글쓴이 | 이지섭 | 작성일 | 2024-08-05 | 수정일 | 2025-08-08 | 조회수 | 3405 |
Spring Boot 의 Hibernate 에서
명시적으로 외부에서 제공되는 connection pool 을 사용하지 않을 경우
내장된 connection pool 을 사용하게 된다.
이럴때
[WARN] HHH10001002: Using built-in connection pool (not intended for production use)
와 같은 메시지가 나오게 된다.
이럴 때는 아래의 참조된 URL 중 docs.jboss.org 의 문서를 참조할 수 있다.
외부에서 제공되는 production 환경의 connection pool 을 사용하는 것이다.
여러가지의 connection pool 을 사용할 수 있다.
아래에 Hikari Pool 설정을 기재하였다.
그리고 c3p0 connection pool 의 설정 정보 hibernate.cfg.xml 파일을 기재해 놓았다.
메이븐 의존성 설정이다. <dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
<version>6.6.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-hikaricp</artifactId>
<version>6.6.1.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-c3p0</artifactId>
<version>6.0.0.Final</version>
</dependency>
hibernate.cfg.xml 파일 내용이다. (Hikari pool) <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property>
<property name="hibernate.hikari.driverClassName">com.mysql.cj.jdbc.Driver</property>
<property name="hibernate.hikari.jdbcUrl">jdbc:mysql://localhost:3306/test?autoReconnect=true&useSSL=false</property>
<property name="hibernate.hikari.username">user1</property>
<property name="hibernate.hikari.password">pass1</property>
<property name="hibernate.hikari.minimumIdle">5</property>
<property name="hibernate.hikari.maximumPoolSize">10</property>
<property name="hibernate.hikari.idleTimeout">30000</property>
<property name="hibernate.hikari.leakDetectionThreshold">60000</property>
</session-factory>
</hibernate-configuration>
hibernate.cfg.xml 파일 내용이다. (c3p0 pool) <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.cj.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test?autoReconnect=true&useSSL=false</property>
<property name="hibernate.connection.username">test</property>
<property name="hibernate.connection.password">1234</property>
<property name="hibernate.connection.pool_size">10</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.min_size">10</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">3000</property>
<property name="hibernate.c3p0.max_statements">50</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.validate">1800</property>
<property name="hibernate.c3p0.unreturnedConnectionTimeout">30</property>
<property name="hibernate.c3p0.debugUnreturnedConnectionStackTraces">true</property>
</session-factory>
</hibernate-configuration>
참조한 웹 페이지
| |||||||
로그인 | Language : |