Refresh pool can break any code at any time
As shown in #11400 (closed), the pool can be refresh at any time since rev 32cd371b3e9c and so code using pool instance can also in many cases:
- The pool instance has no more objects, this can be solved by storing the
_pool
on the instance - The pool singleton for a database can be stopped (not initialized) at any time. I see at least two possible solutions:
- Keep the previous pool instance and use it as fallback if the current one is not initialized
- Raise a specific exception so the dispatcher, cron or worker can retry it with a initialized pool.