Glock 17 ALL THE WAY!
Yes, the stopping power of a 12 gauge is great, but your only gonna get one shot. 9mm is a very deadly round. People play it down, but when is the last time you saw someone shot by one?
Load it up with hollow points, and call it good.
Because if you have got a cracked out, drug crazed, pcp addict busting into your house (this always seems to be the debate when it comes to stopping power) and he/she would not go down with 2 or 3 hollowpoints to the chest, you would still probably have to deliver a pretty good hit, probably almost dead center mass, or head, with the buckshot to put them down.
Also with the 9mm, you can have an extra mag.