I think you will find there are two schools of thought on shock collars and electric fences. Personally I wouldn't use either but if used correctly I don't think they are necessarily cruel. Many folks in the US use them successfully...and I am sure, like anything else, there are boneheads using them.
The reasons I won't use them are this: (no judgement here, just MY reasons!) I think there are better ways to train...a shock collar is kind of a "cop out", dogs can get immune to the shock and ignore it and in the case of electric fences, they MAY (when prey drive in full gear dogs can easily blast through 'em) keep you dog in but they definitely WON'T keep anyone OUT.
In this case my advice would be to pour some concrete or otherwise reinforce the fence and/or just stay outside with the pup.
Mom to the late Cyrus the Fluffweiler CGC forever in my heart and James the Alpha cat