Welcome Guest, Not a member yet? Register   Sign In
How to cope with deadlocks?
#4

[eluser]kezman[/eluser]
Thanks for answers!

I tried to re-issue a transaction 100 times (with a loop) with sleep(10) but it didn't help.

I know that READ COMMITTED level will help to prevent gap locks, but I don't want to switch, because in one transaction I won't see the results of the previous insert and I need it.

Code:
START TRANSACTION;
INSERT INTO A (..., ....) VALUES (1, 2);
INSERT INTO B (...., ...) VALUES (3, last_inserted_id_in_a_table);
COMMIT;

Using READ COMMITTED level this stuff won't work.


Messages In This Thread
How to cope with deadlocks? - by El Forum - 02-10-2013, 09:32 AM
How to cope with deadlocks? - by El Forum - 02-11-2013, 04:22 AM
How to cope with deadlocks? - by El Forum - 02-11-2013, 04:55 AM
How to cope with deadlocks? - by El Forum - 02-11-2013, 11:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB