Can I change the maximum pool size for connections, and what determines what I should install it on?

Meet the following error with our J2EE application:

java.sql.SQLException: An error occurred while distributing the connection. Cause. The connections used are equal to the maximum pool size and the maximum timeout. Cannot allocate more connections.

How do I know how many connections are currently in use in an application, and what should be the optimal connection pool settings for an application with high traffic? Can I change it and how to determine what I should install it on (is it a memory problem, bandwidth, etc.)?

+3
source share
4 answers

,

, . - - JMX . , , .

applicaiton

, ?

, , , . , , :

Connection conn = null;
try {
  conn = ... ; // get connection
  // do stuff
} finally {
  if (conn != null) try { conn.close(); } catch (Exception e) { }
}

, , , .

+5

, , ? .

, finally. :

finally 
{
   closeAll(resultSet, statement, connection);
}

- ( ... , ), .

+2

, , . jconsole jvisualvm, , , -, .

jdbc Java EE, .

+2

, , , , , :

. , ?

. , ? "" ? , ?

. ? . , ?

. ? 5 250 Oracle, , . 50. .

To give a more detailed answer, you need to provide additional information about this application.

Good luck

0
source

Source: https://habr.com/ru/post/1704018/


All Articles