1# Apply the below datasource connection validation:
2# You should have to set "idle-timeout-minutes" with the appropriate values:
<idle-timeout-minutes>30</idle-timeout-minutes> <!-- for example, by default 30 minutes-->
3#Application code must handle exceptions that arise while a connection is held (InUse) by the application component
Upon completion of connection usage (even if the connection has failed), the application code must explicitly call Connection.close() to return the connection to the pool..
You should close all the opened resources (like Connection, sessions, Statement, ResultSet, PreparedStatement, CallableStatement) properly in finally block of the individual methods instead of in the try block and close the connection object in the finally block of the parent method.