It would probably take a fairly strong jolt to keep a bear out, especially if they are hungry! We had problems with black bears in North Vancouver. My roommates put the garbage can outside in the car port, I heard som odd noises and went to investigate. I slammed the door closed pretty darn quickly As there was a big black bear with its head in the “bear resistant” garbage can. I came back with a pot and spoon and scared it off fairly easily, but it took my garbage can with it! I finally found it in the wooded area behind the house about a week later, he had stepped on the middle of it trapping some trash in the bottom of the can, so he tore through the bottom of the heavy plastic can to get to it.
My uncle sometimes has issues with grizzlies up North (Dawson creek) and they have left muddy paw prints on the doors. It’s been better since he got a pair of dogs that live in the yard, but that scares me.