Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1954

Concurrent INSERT/DELETE (no replies)

$
0
0
Hi,

I'm trying to solve concurrent locking on my application. I identified a scenario and I don't know how t solve it.

I have a single table T with a column 'id'.
Transaction are in READ COMMITED mode.

First, I start a transaction where I execute:
INSERT INTO T (`id`) VALUES (1);

Then I start a second transaction where i execute :
delete from T where id in (3,4,5,6);


The last query is blocked par locks . If I execute "delete from T where id=3" the query is not locked.


SHOW ENGINE INNODB STATUS give me :

------- TRX HAS BEEN WAITING 10 SEC FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 0 page no 3776 n bits 72 index `PRIMARY` of table T trx id 171E2D lock_mode X locks rec but not gap waiting
Record lock, heap no 3 PHYSICAL RECORD: n_fields 3; compact format; info bits 0


Is there a way to prevent query to be locked ?

Viewing all articles
Browse latest Browse all 1954

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>