Added logic for creating new connections on middleware when dbconfig is found and need a fix to improve the multithreaded access.