Re: [Twisted-Python] twisted.enterprise.adbapi and connection pool problem
15 Feb 2005 15 Feb '05
Restart was clean, while nobody was connected to the daemon. IMHO it shouldn't go this way. Is there any solution to this problem? Or maybe I must take care of myself and try to detect such occurence and recreate dbpool?
There's no need to recreate dbpool, basic reconnecting logic is already there, if you look in SVN.
Specifically, look at the ConnectionPool class: There are two kwargs that you can pass, cp_reconnect and cp_good_sql.
I use this version in production as part of a simple database uptime monitor, and it works in a satisfactory manner. You may need to trap ConnectionLost errors in some cases, in order to re-send your original query.
Hope this helps,
Age (days ago)
Last active (days ago)
L. Daniel Burr