<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def select(self, db):
 """Changes db index for all free connections. All previously acquired connections will be closed when released. """

        res = True
        async with self._cond:
            for i in range(self.freesize):
                res = res and (await self._pool[i].select(db))
            else:
                self._db = db
        return res