some playing around to get the correct number of db connections and
service activator threads to avoid connection starvation or race
conditions.