Datasource configuration

Asked

Viewed 212 times

1

I am with a java application running on wildFly 8 and using Sql Server, the problem I am going through at the moment is that comes a moment the application returns me saying that I could not open the connection, I checked in the code and all the features that performs transactions in the bank are being closed, a boy from the infra informed me that the problem lies in the wildfly that is not killing the connections, the solution proposed by him is to define the life time of the connection within the wildfly.

I would like your help in resolving this problem. Obs: The database 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>

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 it can have up to 100 open connections in your pool, the application will try to open all these connections at a given time and will not get (because the database will not allow), causing the problem.

To solve, set the max-pool-size to 5:

<max-pool-size>5</max-pool-size>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.