Query Q1 is executed which selects from table
a is locked for writing (L1) while the Q1 runs.
When query Q2 attempts to write to table
a is immediately locked for reading (L2). Q2 is in the 'waiting for table level lock' phase, i.e. it hasn't started executing the update but L2 is already effective.
As a result, L2 will be held from the start of Q2 all the way while Q1 executes plus, when Q1 is finished, while Q2 executes.
This doesn't make sense. Shouldn't L2 become effective only after Q2 is not waiting on L1 any more?