handle mysql link close exception