dbB.close();
is causing the above mentioned error.
Closing of db connection can be ideally achieved in two ways:
1. You may close the connection automatically by setting idle time in configuration
2. Or Initiating db connection on api call and closing the db connection after executing the query.