revamped mysql usage to use a connection pool, revamped cluster id detection on wait