3 Replies Latest reply on Dec 21, 2012 3:34 PM by Justin Bertram

    JBoss AS7 JNDI Datasource Database pooling not really pooling.

    techsjs2012 Newbie

      JBoss AS7 JNDI Datasource Database pooling not really pooling.

       

      I have a MySQL datasource setup with a min pool size set to 5 but if I do a "show processlist;" in MySQL I only see one connect?

       

      Why is JBoss not opening the 5 min connections?

       

       

      Below is my xml:

       

      <datasource jta="false" jndi-name="java:jboss/datasources/mySQLDB" pool-name="MySQL" enabled="true" use-ccm="false">

                          <connection-url>jdbc:mysql:/xxx/jsmith1</connection-url>

                          <driver-class>com.mysql.jdbc.Driver</driver-class>

                          <driver>mysql-connector-java-5.1.21.jar</driver>

                          <pool>

                              <min-pool-size>2</min-pool-size>

                              <max-pool-size>10</max-pool-size>

                              <use-strict-min>false</use-strict-min>

                          </pool>

                          <security>

                              <user-name>jsmith</user-name>

                              <password>xxxx</password>

                          </security>

                          <validation>

                              <validate-on-match>false</validate-on-match>

                              <background-validation>false</background-validation>

                          </validation>

                          <statement>

                              <share-prepared-statements>false</share-prepared-statements>

                          </statement>

      </datasource>

        • 2. Re: JBoss AS7 JNDI Datasource Database pooling not really pooling.
          techsjs2012 Newbie

          <datasource jta="false" jndi-name="java:jboss/datasources/mySQLDB" pool-name="MySQL" enabled="true" use-ccm="false">

                              <connection-url>jdbc:mysql://xxxx/jsmith1</connection-url>

                              <driver-class>com.mysql.jdbc.Driver</driver-class>

                              <driver>mysql-connector-java-5.1.21.jar</driver>

                              <pool>

                                  <min-pool-size>2</min-pool-size>

                                  <max-pool-size>10</max-pool-size>

                                  <use-strict-min>false</use-strict-min>

                              </pool>

                              <security>

                                  <user-name>jsmith</user-name>

                                  <password>xxxx</password>

                              </security>

                              <validation>

                                  <validate-on-match>false</validate-on-match>

                                  <background-validation>false</background-validation>

                              </validation>

                              <statement>

                                  <share-prepared-statements>false</share-prepared-statements>

                              </statement>

                          </datasource>

          • 3. Re: JBoss AS7 JNDI Datasource Database pooling not really pooling.
            Justin Bertram Master

            What happens if you set <prefill> to "true"?  For example:

             

            <datasource jta="false" jndi-name="java:jboss/datasources/mySQLDB" pool-name="MySQL" enabled="true" use-ccm="false">
                <connection-url>jdbc:mysql://xxxx/jsmith1</connection-url>
                <driver-class>com.mysql.jdbc.Driver</driver-class>
                <driver>mysql-connector-java-5.1.21.jar</driver>
                <pool>
                    <min-pool-size>2</min-pool-size>
                    <max-pool-size>10</max-pool-size>
                    <use-strict-min>false</use-strict-min>
                    <prefill>true</prefill>
                </pool>
                <security>
                    <user-name>jsmith</user-name>
                    <password>xxxx</password>
                </security>
                <validation>
                    <validate-on-match>false</validate-on-match>
                    <background-validation>false</background-validation>
                </validation>
                <statement>
                    <share-prepared-statements>false</share-prepared-statements>
                </statement>
            </datasource>