InterviewSolution
| 1. |
What is a connection leak, and how can we fix it in Java? |
|
Answer» A connection leak implies a portion of the information base request/transaction are not getting shut as EXPECTED or are not getting committed. Lastly, those connections are getting abandoned and shut down all time. To fix the leaks, you have to find where you have used the OPENING connections and then use TRY-with-RESOURCES that will do all the close() stuff for you. Exampletry (Connection connection = DriverManager.getConnection(url); |
|