If you have tried everything (i.e burying wire under the fence line, taking the dog for lots of walks so its not bored and wanting to escape etc etc) you can have great success with the electric wire. I will say make sure it is connected to a battery not a the main line as it is safer all around.
Also you will prob be able to turn it off after they have zapped themselves a few times. Just make sure you are home the first few days after you install it.
"In order to really enjoy a dog, one doesn't merely try to train him to be semihuman. The point of it is to open oneself to the possibility of becoming partly a dog." - Edward Hoagland