Here is the syllabus explained in the video above. If you have any questions, post them in the comments section at the bottom of the page.
Processing of the immunoglobulin genes
The gene segments that encode the variable regions of immunoglobulins are widely separated in the genome in all the cells of the body, except those of the B lineage.
Given the arrangement of the genes in segments on different chromosomes, immunoglobulin production is impossible unless something else happens. These genes are brought together in the bone marrow during B-cell maturation, through a process of recombination between the different gene segments called somatic recombination. This process not only contributes to the generation of diversity but is essential for immunoglobulins to be expressed, which is why only B cells can produce them.
Processing of the heavy chains
In the heavy chains, 2 somatic recombinations take place. In a first recombination step, a D gene is again combined at random with a J gene, so that they lie next to each other on chromosome 14. Then a V gene is also combined at random with the D-J fragment that was formed previously (Figures 8.2 and 8.4).
In both recombinations, large stretches of DNA are lost and, as a result, the 3 fragments V, D and J, which were initially separate, end up contiguous. These 3 fragments (V-D-J) form an exon for the variable domain of the heavy chain. The remaining constant domains will be encoded by a C gene (there are 9 C genes, one for each class and subclass of immunoglobulin).
Processing of the light chains
In the case of the light chain, somatic recombination occurs once (between a V fragment and a J fragment) (Figures 8.3 and 8.4). For the κ chain, a V gene and a J gene (separate in the genome) are combined at random, generating an exon that, when translated into protein, will encode the variable domain of its light chain. There is no problem for the constant domain, since there is only one C gene. In the case of the λ chain the same happens, but the C gene that follows the randomly chosen J gene is the one expressed. In this way, a large segment of circular DNA is excised.
This gene rearrangement occurs during B-cell maturation in the bone marrow. This recombination makes it possible to synthesise a messenger RNA containing the necessary V, J and C segments, which will be brought into line by intron splicing (large segments of RNA are removed during processing).
Mechanism of somatic recombination
For the mechanism of somatic recombination to be possible, two elements are essential: the recombinases and the recombination signal sequences (RSS).
The recombinases (Figure 8.4) are specific enzymes that form heterodimers and are known as RAG-1 and RAG-2. For example, in the case of λ they bind to a V gene (V3) and a J gene (J2).
The recombination signal sequences (RSS) (Figure 8.4) are highly conserved nucleotide sequences that flank the gene segments. These signals consist of a sequence of 7 base pairs (heptamer) and another of 9 (nonamer), separated by a non-conserved spacer DNA of 12 or 23 bp.

(Reproduced from Regueiro J.R., López C., González S. & Martínez E. (2011) Inmunología. Biología y Patología del Sistema Inmune. (4th Ed.) Editorial Médica Panamericana, Madrid.)
There are RSS downstream of each V fragment and upstream of each J segment. The D fragments have RSS both upstream and downstream, since they will take part in 2 somatic recombinations (the first at the downstream end when combined with a J segment, and the second at the upstream end when combined with a V segment).
The heptamer and nonamer sequences of the RSS are complementary to one another, so that the downstream sequences of the V segment will be complementary to the upstream ones of the D segment, and the downstream sequences of the D segment will be complementary to the upstream ones of the J segment (this allows palindromes to form).
The length of the spacer regions seems to play an important role in ensuring that somatic recombination takes place in an orderly way (V-D-J), since it occurs only between a heptamer-nonamer pair separated by 12 base pairs (bp) and another heptamer-nonamer pair separated by 23 bp. These 12 bp and 23 bp spacer sequences are located in alternation on the different gene segments.
For this reason, in the heavy chains a V-J recombination cannot occur, since both regions are flanked by 23 bp spacers. But they can recombine with the D segments, since these are flanked by 12 bp spacers.
The recombination signals are recognised by the specialised enzymes (recombinases) RAG-1 and RAG-2 which, by coming together, bring the fragments together at random, forming a loop in the DNA that is stabilised by the palindromes between the signalling heptamers and nonamers. The recombinases then resolve the loop by cutting, ligating the 2 fragments and excising the loose ends (in the form of circular DNA). Everything that was in the loop is lost and cannot be recovered. In this cutting and splicing of the fragments, which is imprecise, nucleotides are dragged along at random and nucleotides are sometimes inserted. This is a mechanism for increasing the variety of Igs, as we shall see later, but it can also alter the reading frame, giving rise to premature STOP codons or to non-functional (abortive) proteins.
Because the rearrangement system is very imprecise, errors can occur in rearranging the fragments in both B cells and T cells, producing abortive proteins (STOP codon or change in the reading frame) at random, which are of no use whatsoever (non-productive rearrangements) (Figure 8.5). For this reason, in the processing of both heavy and light chains, initial non-productive rearrangements can be rescued (as long as V, D and J fragments remain available) and the corresponding chromosomes can be rearranged again at random until productive rearrangements are obtained; the limit is therefore the number of fragments that remain. Once a productive rearrangement has been achieved, a signal halts the process.

(Reproduced from Murphy K., Travers P. & Walport M. (2008) Janeway’s Immunobiology (7th Ed.) Garland Science, New York.)