If two transaction occure same time. The system ensure a control,due to that one transaction do not adversely affect the other. This is called concurrency control.
1. Pessimistic concurrency control: System locks prevents users from modifying data in a way that affects other users. After a user performs an action that causes a lock to be applied, other users cannot perform actions that would conflict with the lock until the owner releases it.
2. Optimistic concurrency control: This is called optimistic because it is mainly used in environments where there is low contention for data, and where the cost of occasionally rolling back a transaction outweighs the costs of locking data when read.