パルカワ2

最近はFlutterをやっています

2013-08-07から1日間の記事一覧

存在しないデータにselect ... for updateしたあと、insertしようとしたら、デッドロックしちゃってつらい。

mysql> start transaction; # 存在しないuniq制限ありなデータにfor update mysql> select * from hoge where piyo_id = 1 and fuga_id = 1 for update; mysql> insert into hoge (piyo_id, fuga_id) value (1,1);をAとB交互にしたら、Aでinsertするとき待ち…