I was going through the examples of deadlock exceptions online and found this link
As I understand, here we have two processes (session 1 and 2). The first one acquires lock on pd1, and second acquires on pd2. Then after that, first one want to read from pd2 and second one from pd1.
What I dont get is that why do we have a deadlock here. Wouldnt it work in a way that session updates and once it is done updating, it will release the lock on pd1, and with that session 2 will be able to read from pd1. Similarly the other way round? Why does the Update + Select has to be a single operation here?
Is it because they are part of the same transaction, hence within a transaction they wont let go of their locks acquired on any object?