I need a database connection pool that can reconnect to a different
replicated failover server if the main server stop working. I found
DButil SteadyDBConnection works great in transparently reconnect if the
connection is lost, but to try a different server I'm trying some
changes that incorporate some ideas from sqlalchemy pool.py.
Instead of pass as first arg of SteadyDBConnection a dbapi module should
be possible also pass a callable function that must return a newly
connected DBAPI connection object as in this example:
from DBUtils.PersistentDB import PersistentDB
conn = kinterbasdb.connect(dsn=dsn1,...)
conn = kinterbasdb.connect(dsn=dsn2, ...)
persist = PersistentDB(getconn)
In the callable function we can implement also other nice things as load
I've just started with some changes in SteadyDBConnection.py and
PersistentDB.py, and a very basic test seems to work, before I go on
anyone has some ideas or is interested in look at my code?