A bidirectional virtually paired relationship is like a bidirectional physically paired relationship in that:
It links two segment types, a logical child and its logical parent, in two directions, establishing a two-way path.
It can be established between two segment types in the same or different databases.
Figure below shows a bidirectional virtually paired relationship between the CUSTOMER and INVENTORY databases. Notice that although there is a two-way path, a logical child segment exists only in the CUSTOMER database. Going from the CUSTOMER to the INVENTORY database, IMS uses the pointer in the logical child segment. Going from the INVENTORY to the CUSTOMER database, IMS uses the pointer in the logical parent, as well as the pointer in the logical child segment.
To define a virtually paired relationship, two logical child segment types are defined in the physical databases involved in the logical relationship. Only one logical child is actually placed in storage. The logical child defined and put in storage is called the real logical child. The logical child defined but not put in storage is called the virtual logical child.
IMS maintains data in both paths in a virtually paired relationship. However, because there is only one logical child segment, maintenance is simpler than it is in a physically paired relationship. When, for instance, a new CUSTOMER segment is inserted, only one logical child segment has to be inserted. For a replace, the data only has to be changed in one segment. For a delete, the logical child segment is deleted from both paths. Notice the trade-off between physical and virtual pairing. With virtual pairing, there is no duplicate logical child and maintenance of paired logical children. However, virtual pairing requires the use and maintenance of additional pointers, called logical twin pointers.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!