Configuration datasource

1

I have a java application running in wildFly 8 and using Sql Server, the problem I'm having at the moment is that the application comes back to me saying that it was not possible to open the connection, I checked the code and all the features which performs transactions in the bank are being closed, a boy from the infra informed me that the problem is in the wildfly that is not killing the connections, the solution proposed by him is to define the lifetime of the connection inside the wildfly.

I would like your help to remedy this problem. obs: The bank is configured to accept a maximum of 5 connections.

<datasources xmlns="http://www.jboss.org/ironcajamar/schema">
<datasource jndi-name="java:jboss/datasources/focusDS1" pool-name="focusDS1">
<connection-url>jdbc:jtds:sqlserver://dsdb03:1433/sis</connection-url>
<driver-class>net.sourceforge.jtds.jdbc.Driver</driver-class>
<driver>jtds-1.2.4.jar</driver>
<pool>
    <use-strict-min>true</use-strict-min>
    <min-pool-size>1</min-pool-size>
    <max-pool-size>100</max-pool-size>
 </pool>
 <security>
    <user-name>XXXXX</user-name>
    <password>XXXXX</password>
 </security> 
     <validation>
      <check-valid-connection-sql>select 1</check-valid-connection-sql>
     </validation>
    <timeout>
      <idle-timeout-minutes>1</idle-timeout-minutes>
      <allocation-retry>6</allocation-retry>
    </timeout>
</datasource>
</datasources>
    
asked by anonymous 26.02.2018 / 14:53

1 answer

0

I think the problem is here:

<max-pool-size>100</max-pool-size>

If the database is configured to accept up to 5 connections and you define that you can have up to 100 open connections in your pool, the application will attempt to open all these connections at any given time and will not (as the database does not will allow), causing the problem.

To resolve, set max-pool-size to 5:

<max-pool-size>5</max-pool-size>
    
08.03.2018 / 21:52