Christoph Zwerschke said:
> Warren, it would be also great if you could add your =93DbConnectionPoo=
> to the DBUtils suite, as another DB pooling module. DBConnectionPool
> uses a different approach for dealing with bad connections (by running
> an =93expiration=94 thread), so it would be good to have it as an alter=
I have looked over your code and I am impressed. You have done a much
better job of addressing the issue of database resource stability than I
did with DbConnectionPool. In fact, if you were to add the expiration
feature, I see no reason why anyone would want to use DbConnectionPool
over your code for database connections.
DbConnectionPool was a fairly simple approach to resource pooling. In
fact, very little of the code is actually database connection specific.=20
Because of this, I have since factored out the core pooling and expiratio=
logic into a ResourcePool module and used it for pools of other kinds of
resources, such as ftp connections, FormKit form objects, etc. It works
fine as a generic caching mechanism for things whose creation can be time
consuming and whose state must be "owned" by only a single thread at a
time. However, it does not provide a good solution to resources that
become bad before expiration. For this reason, it is not as well suited
to database connections (or any external resource connection for that
matter) as your solution is.
Your concept of "tough" database connections is intriguing and could, wit=
a little work, be abstracted and reused to make other kinds of "tough"
resources. This would be a valuable tool for Webware specifically, but
also for the Python community in general.
Others have suggested that your work become a package separate from
Webware. I agree. As far as I can see, there is nothing except examples
in the documentation that is Webware specific.