Add support for using connection pool to fix issue with orphaned connections in ActiveRecord