Subject: | WISHLIST: Appender::DBI could optionally use DBIx::Connector to be fork and threadsafe |
Date: | Wed, 7 Apr 2010 15:56:12 +0100 |
To: | bugs-Log-Log4perl [...] rt.cpan.org |
From: | Matt S Trout <mst [...] shadowcat.co.uk> |
If you stored a connector object instead of a dbh directly, DBIx::Connector's
reconnect logic would handle the ping() stuff for you, and as an addded
bonus it checks pid and tid for you and auto-reconnects which would make
Appender::DBI threadsafe.
simply having a get_dbh method that does
$self->{dbh} || $self->{connector}->dbh
would do for a start - using DBIx::Connector's logic more extensively would
be nice (and if you like the idea I can probably get somebody to patch it
for you) but the key thing is to get the thread/fork safety in there so
it's safe to use in e.g. Catalyst
--
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
Technical Director and a commit bit: http://shadowcat.co.uk/catalyst/
Shadowcat Systems Limited
mst (@) shadowcat.co.uk http://shadowcat.co.uk/blog/matt-s-trout/