Generally, in order to apply joint locks in jiu jitsu effectively, you need to follow this principle:
When attacking a joint, it’s important that you control the both the joint directly above (proximal) and directly below (distal) it. This completely immobilizes the compromised joint and allows the applied leverage to be transferred more directly against it. If you fail to do this, your opponent may be able to escape by rotating around the axis of the joint.
A prime example of this principle is the straight arm-lock or juji-gatame. When attempting this technique, the joint that is being attacked is the elbow. The joint directly above the elbow (proximal to the centre of the body) is the shoulder, and the joint directly below it (distal to the centre of the body) is the wrist.
This is why when you learned the juji-gatame you were told to pinch your opponent’s shoulder between your legs and control his wrist by making sure his thumb was pointing to the ceiling. A violation of these two details of the technique often results in an ineffective joint-lock which allows the opponent to attempt an escape. It is sometimes sufficient to control just the joint directly above the attacked joint, but much more effective to control both adjacent joints simultaneously.
Below are some visual examples:
Ineffective Joint Attack
Try this out for yourself. Next time you are attempting a joint-lock submission on an opponent and it is not working properly, ask yourself “Am I controlling the joints both above and below?”. I think you will be surprised at what you observe.