A device and method can detect, and also break, an occurrence of gas lock in an electrical submersible pump assembly in a well bore based upon surface or downhole data without the need for operator intervention. To detect an occurrence of gas lock, an instantaneous value is monitored using a sensor. Then a controller compares the instantaneous value to a threshold value over a predetermined duration to thereby detect the occurrence of gas lock in the electrical submersible pump assembly. Sensors can include, for example, a differential pressure gauge, a pressure gage located in a pump stage located toward the inlet, a fluid temperature sensor located toward the discharge, a free gas detector located near the pump discharge, an electrical resistivity gage, a flow meter located within surface production tubing, and a vibration sensor attached to a tubing string to measure a vibration signature.