Answers

Question and Answer:

  Home  Web Logic Server

⟩ Can you explain what are the ways to avoid ResourceExceptions when sending requests for databaseconnections?

The problem with the servers is to have few resources or the database connection in the connection pool to decrease the work load. The servers need to increase the maximum number of connections in the connection pool and utilize it to balance the overall load on the server. The server needs to be optimally designed to allow the connection pool to execute few threads and get the work done. The application should be designed to find out whether there are connections available or not. If there are connections available then it shows the message of NoResourceException. This is shown by the example:

try{

// your statement

} catch(Exception handleEx) {

// your statement

} finally {

try{ conn.close();

}catch (Exception ignore){} // this returns the connection pool

}

 180 views

More Questions for you: