I have a procedure of mysql:
START TRANSACTION;
insert into table1(id, name) values(1, 'a'); -- id is a primary key.
...
delete from table1 where id = 1;
COMMIT;
and a multithread call to this procedure will show error in jdbc
Duplicate entry ‘1’ for key table1_UNIQUE_key’
why the other thread will not wait for this thread end?
It is because If you check, you have declared the table as
INODBengine, which allows a row level lock, if it had beenMYSAMthis problem would not occur