Home > Software engineering >  How to remove connection pool warning in Hibernate 6 (not intended for production use)?
How to remove connection pool warning in Hibernate 6 (not intended for production use)?

Time:02-03

I am getting the following warning!

WARN: HHH10001002: Using built-in connection pool (not intended for production use)

My persistence.xml is as follows:

<persistence xmlns="https://jakarta.ee/xml/ns/persistence" version="3.1">
    <persistence-unit name="com.peuconomia.hibernate.aws_mysql_latest">

            <properties>
                
                <property name="jakarta.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/hibernate_tutorial"/>
<!--                <property name="jakarta.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>-->
                
                <property name="jakarta.persistence.jdbc.user" value="root"/>
                <property name="jakarta.persistence.jdbc.password" value="123qweasdzxc"/>
                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

  

                <property name="hibernate.hbm2ddl.auto" value="create"/>
                
                <property name="hibernate.show_sql" value="true"/>
                <property name="hibernate.connection.pool_size" value="100"/>
            </properties>

    </persistence-unit>
</persistence>

I have setup the hibernate.connection.pool_size to 100. However the warning still remains the same!

<property name="hibernate.connection.pool_size" value="100"/>

How can I fix this and work with production?

CodePudding user response:

You need to set up one of the ConnectionProviders that is intended for production use. There are instructions in the User Guide.

https://docs.jboss.org/hibernate/orm/6.2/userguide/html_single/Hibernate_User_Guide.html#database-connectionprovider

  • Related