fix the bug of lifecycle of Connection and ConnectionPool class