Soak bean overnight in ample water to cover. Drain the beans and cook in ample water with the baking soda. Bring to a boil and simmer on low for 20 minutes. Drain.
Place 1/3 of beans in a baking pot or crock pot with a lid. Add 1/3 of the chopped ham and 1/3 of the onions. Repeat layers ending with ham. Mix the remaining ingredients with a cup of hot water and pour over the beans. Add additional water to cover within an inch of top of beans. (you can always add more water if it gets too dry.).
Place covered baking pot in a 300 degree oven for 4 hours or longer. (6 hours or so in crockpot) Stir only once or twice during process.