This article is half-done without your Comment! *** Please share your thoughts via Comment ***
Timeout:
When the client application is waiting for a require resource, Timeout occurs.
There are multiple reasons for Timeout like transaction blocking, the distance network, high CPU utilization and multiple request user request at one time.
The Database Timeout cannot affect to other running connection, and it treated independently, but for solving the Timeout issue we need to check other causes like OS response, Network response, Database Timeout threshold value, number of Database Connections and other.
Lock:
When one process is accessing an object, it can request for a lock for that particular object so that other processes cannot perform read or update on that object.
There are different types of lock like Exclusive Lock, Non-exclusive Lock.
An Exclusive Lock prevents object or data from the reading and writing both the actions.
A Non-Exclusive Lock allows read-only access for an object or data, but it prevents the write action for an object or data.
Block:
If two processes are accessing the same resource so at that time one process has to wait until the other process releases the occupied resource.
This is called blocking because one transaction is blocked by another transaction and all blocked processes kept in the waiting queue.
If the blocked transaction is waiting for a long time, it may generate a Database Timeout.
If the long-running blocked transaction requires a lock, it may generate a Database Deadlock.
One X process is waiting to complete the transaction of the Y process, and the same time, Y process is blocked because it is also waiting to complete the transaction of the X process.
This is called as Deadlock situation.In the Deadlock situation, both the processes trying to access a particular resource and also has a lock on that resource by each other, so both are waiting for each other to release a lock and complete the transaction.
Deadlock is a next stage of the blocking situation so if you want to avoid Deadlock situation, you should first find the blocked transaction and tried to remove internal dependency for those transactions.