Ergodic problem for the Hamilton-Jacobi-Bellman equation. II