Changed batch connection pool into context manager class