A wait-for graph is a directed graph used for deadlock detection in operating systems and database systems.
In the following example, Txn1 locks var1 then var2. Tsn2 locks var2 then var1. This can lead to a cycle in the wait-for graph, a dead-lock. An integrity constraint over both var1,var2 makes this more likely, because any update to either variable will require reading the other to check the constraint.