DBUtils icon indicating copy to clipboard operation
DBUtils copied to clipboard

What behaviour for creator when no connection can be created?

Open telukwg opened this issue 2 months ago • 3 comments

Hi, I am using DBUtils (perhaps incorrectly) to handle client-managed server failover for a database cluster (ie. the client must select a new DB host when the current host has become unresponsive/failed-in-some-way.)

I have a scenario where there are potentially, no working hosts left in the cluster, and I want to code my creator function correctly so that DBUtils responds most correctly.

So - when I have run out of working hosts - should I have my creator function raise an Exception in this case? Should it be any particular Exception? (ie. one listed in the "failures" pool argument, one specifically NOT in the "failures".) Should I just return a "None"? (*I'm guessing not - my test code resulted in connection object after calling "pool.connection()".

I am using v3.11 of DBUtils, and the PooledDB type.

Thank-you and regards, Bill.

telukwg avatar Sep 24 '25 07:09 telukwg