Hi Nguyen
There is already a support ticket open for your question. See 2661
However, The FileManager are using the connection pool of the External Database to get a connection to the file database. If your threads are blocked in the getConnection method means, all connections of the pool are in use. Your threads have to wait for a connection to get free again.
You can see the number of connections in the pool and how many connections are in use in the Engine Cockpit in the menu Services/External Databases
.
Because all of your threads are blocked on getConnection it seems that you have a resource leak in the code of the FileManager. The FileManager should always close the connection after it has used it. Like this:
try (Connection connection = getConnection()) {
// use connection
} // automatically closes the connection
or
Connection connection = getConnection()
try {
// use connection
} finally {
connection.close(); // explicit close the connection
}
The File Manager does this in normal cases. Unfortunately the connection.close method call is not the only thing it is done in the finally block. I assume that an exception is thrown from inside the finally block before the connection close method is called. This leads to a resource leak. The connection will not be returned to the connection pool because the close method was not called on it.
Connection connection = getConnection()
try {
// use connection
} finally {
stmt.close() // can throw an exception and therefore close on the connection is not called
connection.close(); // explicit close the connection
}
Should be done like this to ensure close is called on the connection:
Connection connection = getConnection()
try {
// use connection
} finally {
try {
stmt.close() // can throw an exception but close on the connection is called anyway
} finally {
connection.close(); // explicit close the connection
}
}
Have a look at the logs for errors in the FileManager code to find the place where the exception is thrown in the finally block to fix the problem. Note, that you should fix all the FileManager code not only the one that is now causing the problem. The other finally blocks could also be affected later.
Hope this helps
Regards
Reto Weiss, Axon Ivy Support