Assuming you don't have stashes, then you are apparently assuming you will have time to get to a specific room, and have time to use a key or enter a combo.
This assumes you recognize the dogs barking as being for a threat, as opposed to a squirrel or the mailman. (Most of us tend to tune out most barking; not everybody recognizes differences, if you do, great, but you still seem to assume you will have time to do whatever you need to do.)
It's simpler to just have one on one's person. Doesn't matter where you are in the house; doesn't matter why the dogs bark.
Edit: TheNocturnus, I have K9 cop friends who love their dogs; but those dogs have the exact function of going in harm's way. I love my dogs; I have put myself between my dogs and aggressive dogs before. That said, if it comes to my wife or kid, or one of the dogs, the dog is just out of luck.