Skip to content

Commit

Permalink
[INTGW-606] - closed the DB connection properly to get rid of the poo…
Browse files Browse the repository at this point in the history
…l exhaustion.
  • Loading branch information
isharamadhawa authored and jaadds committed Jul 2, 2019
1 parent a12cd5c commit bfc635d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class WorkflowAPIConsumerImpl implements WorkflowAPIConsumer {
@Override
public int getAPIID(APIIdentifier apiId) throws APIManagementException {
int id = -1;
Connection connection;
Connection connection = null;

try {
connection = APIMgtDBUtil.getConnection();
Expand All @@ -43,6 +43,8 @@ public int getAPIID(APIIdentifier apiId) throws APIManagementException {
handleException("Failed to retrieve api id. ", e);
} catch (APIManagementException e) {
handleException("Error occured in retrieving api id. ", e);
} finally {
APIMgtDBUtil.closeAllConnections(null, connection, null);
}
return id;
}
Expand Down

0 comments on commit bfc635d

Please sign in to comment.