A connection timeout will usually occur when there are no more available connections in a connection pool (aka database), and will produce a ConnectionWaitTimeout exception.
- In the left panel of the web console, expand Resources > JDBC > Data sources.
- Select a data source.
- Select Connection pool properties.
In this example, the maximum number of connections is 10.
Each database has a certain number of maximum connections. You will need to consult with the database administrator to know the maximum number of connections to the database. Setting the connection timeout to 0 will disable the timeout, which means that the attepted connection will continue indefinitely.
If you have multiple data sources connecting to the same backend database, you will need to be careful not to overload the backend database. For example, if you have 10 data sources with a maximum connections of 50, this creates a maximum of 500 possible connects to the same backend database, which may overload the database, or reduce the performance of the database. It is generally a good idea to se the maximum allowed connects to be less than the maximum threads of a web container.