In the Battle of the Atlantic , the initially successful German U-boat fleet arm was eventually defeated due to Allied technological advances like sonar , radar , and the breaking of the Enigma code . In the Battle of the Atlantic , the initially successful German U-boat fleet arm was eventually defeated due to Allied technological innovations like sonar , radar , and the breaking of the Enigma code .