A bidirectional physically paired relationship links two segment types, a logical child and its logical parent, in two directions. A two-way path is established using pointers in the logical child segments. Figure below shows a bidirectional physically paired logical relationship that has been established between the CUSTOMER and INVENTORY databases.
A physically paired logical relationship can be established between two segment types in the same or different databases. The relationship shown in Figure allows either the CUSTOMER or the INVENTORY database to be entered. When either of the databases is entered, a path exists using the logical child to access one database from the other.
In a physically paired relationship, a logical child is stored in both databases. However, if the logical child has dependents, they are only stored in one database. For example, IMS maintains data in both paths in physically paired relationships. If LINEITEM is deleted from the CUSTOMER database, IMS deletes from the INVENTORY database all INITMSEG segments which point to that particular LINEITEM segment.
If data is changed in a logical child segment, IMS changes the data in its paired logical child segment. Or if a logical child segment is inserted into one database, IMS inserts a paired logical child segment into the other database.
With physical pairing, the logical child is duplicate data, so there is some increase in storage requirements. In addition, there is some extra maintenance required because IMS maintains data on two paths. In the next type of logical relationship ie., Bidirectional virtually paired Logical Relationship, this extra space and maintenance do not exist, however, IMS still allows to enter either of the database.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!