I was reading about database locking(pessimistic,optimistic) mechanism,
session 1:
t1: open transaction:
t2: sleep(3 sec)
t5: updte user set name='x' where id =1
session 2: t2:update user set name='y' where id=1
my doubts are: 1. What will happen at t5 2. does It has to do any thing with Isolation level?if yes what will be the behavior in different isolation level. 3. Does database(mysql,oracle) only do pessimistic locking?