Login

Language :
Title[WARN] HHH10001002: Using built-in connection pool (not intended for production use)
[WARN] HHH10001002: Using built-in connection pool (not intended for production use)
Writer이지섭Write DateAug 5 2024Modify DateSep 12 2024View Count494
Hibernate in Spring Boot 
 
If you do not explicitly use an externally provided connection pool,
 
it will use the built-in connection pool.
 
In this case 
 
[WARN] HHH10001002: Using built-in connection pool (not intended for production use)
 
will be displayed.
 
In this case, you can refer to the documentation on docs.jboss.org from the URLs referenced below.
 
Use an externally provided connection pool for your production environment.
 
There are several connection pools available.
 
Among them, c3p0 is described in the documentation on howtodoinjava.com below.
 
You can open the reference URL below.
 
Below is the hibernate.cfg.xml file with the configuration information of the c3p0 connection pool.
 

Maven dependency settings.

<dependency>
    <groupId>org.hibernate.orm</groupId>
    <artifactId>hibernate-c3p0</artifactId>
    <version>6.0.0.Final</version>
</dependency>

This is the contents of the hibernate.cfg.xml file.

<?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>

 

Referenced web pages

 

Comment

Name               Password 
Content
Check Password.

Please enter your password when registering your comment.