Why there are some transaction which executes for a long time?

I am aware of there are many errors like

Lock wait timeout exceeded; try restarting transaction

and this happens mostly using api to push doc or something, and happens on Web sometime. How to diagnose errors such like this?

on Web, error is

Another transaction is blocking this one. Please try again in a few seconds.
1 Like