Solved the mysql connection issue for concurrent threads