最近DBへの接続をリクエスト単位ではなくリクエストを処理するプロセス単位(Starmanのworkerプロセス単位)でキャッシュしたいということがあって、DBIのconnect_cachedを使うことになった。Scope::Container::DBIでももしかしたら出来るのかもしれないけど、とりあえずconnect_cachedで実装した。そこでいろいろはまったのでメモ。 connect_cachedについて perldocに connect_cached is like "connect", except that the database handle returned is also stored in a hash associated with the given parameters. If another call is made to connect_cached wit