Ezio Vernacotola wrote:
> 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
> import kinterbasdb
> 
> def getconn():
>     try:
>         conn = kinterbasdb.connect(dsn=dsn1,...)
>     except kinterbasdb.OperationalError:
>         conn = kinterbasdb.connect(dsn=dsn2, ...)
>     return conn
> 
> persist = PersistentDB(getconn)
> ######
> 
> In the callable function we can implement also other nice things as load 
> balancing.

I thought that was a good idea; just wanted to let you know that it is 
now implemented in DBUtils 0.9.3.

-- Chris


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Webware-devel mailing list
Webware-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to