Skip Menu |

This queue is for tickets about the Log-Log4perl CPAN distribution.

Report information
The Basics
Id: 56351
Status: open
Priority: 0/
Queue: Log-Log4perl

People
Owner: Nobody in particular
Requestors: mst [...] shadowcat.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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/
On Wed Apr 07 10:57:37 2010, mst@shadowcat.co.uk wrote: Show quoted text
> simply having a get_dbh method that does > > $self->{dbh} || $self->{connector}->dbh
This sounds like an excellent idea, want to send a patch? Just make sure it applies cleanly to the master at http://github.com/mschilli/log4perl and doesn't require DBIx::Connector or additional modules to be installed for normal operation. Thanks!