Say I want to implement a database with a lock system, and I use lock avoidance and try to avoid a potential deadlock before acquiring it.
My question is:
When the session/transaction has already successfully acquired some resource A, and now it tries to acquire lock on resource B, when a deadlock is detected.
Hence, the session fails at acquiring the lock on B, should the system force the session to give up other resources the session is holding, in this case: A, and invalidate the session?
Or are there other more standard way to deal with this situation?