罠シリーズです〜 eclipseのpluginであるDBViewer、結構有名なプラグインです。 今回はDBViewerとMySQL5.5の罠を紹介。 DBViewerには、自動コミットモードと手動コミットモードが選択できる。 手動コミットモードには大きな罠が潜んでいる・・ 罠の内容 対象テーブルにmetadata lockがかかり、drop系SQL(drop database, drop table, drop index etc...)がmetadata lockでwait状態になる。 a table that is being used by a transaction within one session cannot be used in DDL statements by other sessions until the transaction ends http://dev.
![DBViewerのmetadata lockの罠 - 文系プログラマによるTIPSブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/3dc06644c9a8523dc6703efaba12d09238e0b7cb/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Ft%2Ftreeapps%2F20180418%2F20180418131549.png)