Search code examples
mysqlwildflywildfly-10

Wildfly 10 won't prefill


I'm Pretty new to wildfly 10. i have my datasources working and my connector working. i have successfuly connections. i have the prefill setting selected. it just doesn't populate my sql database with any tables.

 <datasource jta="true" jndi-name="java:/MySqlDS" pool-name="MySqlDS" enabled="tru$
                <connection-url>jdbc:mysql://<IP>:3306/DatabaseName?useSSL=false</connection-$
                <driver-class>com.mysql.jdbc.Driver</driver-class>
                <driver>mysql</driver>
                <pool>
                    <min-pool-size>50</min-pool-size>
                    <max-pool-size>500</max-pool-size>
                    <prefill>true</prefill>
                </pool>
                <security>
                    <user-name>user</user-name>
                    <password>password</password>
                </security>
                <validation>
                    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensi$
                    <background-validation>true</background-validation>
                    <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysq$
                </validation>
            </datasource>

Solution

  • You're missing the purpose of prefill. It is to fill the database connection pool pretty much on startup. It doesn't create any tables for you. Usually that is an external process like a SQL script to create the tables. There are other options such as Hibernate that can create tables on startup but that is a different question.